Sets @target instance variable from request parameters.
 @api protected
 @return [Object] Target instance (Returns HTTP 400 when request parameters are not enough)
549566
def set_target
        if (target_type = params[:target_type]).present?
          target_class = target_type.to_model_class
          @target = params[:target_id].present? ?
            target_class.find_by!(id: params[:target_id]) :
            target_class.find_by!(id: params["#{target_type.to_resource_name}_id"])
        else
          render plain: "400 Bad Request: Missing parameter", status: 400
        end
      end
1177040
def attributes(instance)
      definitions.values.each_with_object({}) do |item, obj|
        key = item.target
        val = instance.send(:instance_variable_get, item.ivar)
        obj[key] = val unless null == val
      end
    end
275704
def target
      @target ||= begin
        parent = context[:parent]
        if parent.is_a? RailsWorkflow::Operation
          parent.becomes(RailsWorkflow::Operation)
        elsif parent.is_a? RailsWorkflow::Process
          parent.becomes(RailsWorkflow::Process)
        end
      end
    end
1297657
def view_assigns
      protected_vars = _protected_ivars
      variables      = instance_variables

      variables.reject! { |s| protected_vars.include? s }
      variables.each_with_object({}) { |name, hash|
        hash[name.slice(1, name.length)] = instance_variable_get(name)
      }
    end
1067017
def create_getter(name, value)
      instance_variable_set(:"@#{name}", value)
      create_method(name.to_sym) do
        instance_variable_get(:"@#{name}")
      end
    end
494341
def set_target_variable (self, targets, variable, value, append=0):
        
        if isinstance (targets, str):
            targets = [targets]
        if isinstance(value, str):
            value = [value]

        assert is_iterable(targets)
        assert isinstance(variable, basestring)
        assert is_iterable(value)

        if targets:
            if append:
                bjam_interface.call("set-target-variable", targets, variable, value, "true")
            else:
                bjam_interface.call("set-target-variable", targets, variable, value)
288115
def to_hash
    self.instance_variables.inject({}) { |m,v| m[v[1,v.length].to_sym] = instance_variable_get(v); m }
  end
27591
def request=(request)
      self.user_ip    = request.remote_ip
      self.user_agent = request.env['HTTP_USER_AGENT']
      self.referrer   = request.env['HTTP_REFERER']
    end
433351
def target_create(self, data, **kwargs):
        ""
        api_path = "/api/v2/targets.json"
        return self.call(api_path, method="POST", data=data, **kwargs)
450881
def _bind_variables(self, instance, space):
        
        instance.api = self
        if space:
            instance.space = space
        return instance
376678
def instantiate(params)
      instance = Instance.new( *interpolate(params), @parent )
      instance.apply_resource_type
      instance
    end
13663
def method_instance
    lazy_var :@method_instance do
      # Just drop a warning if we can't get the method object
      logger.catch.warn(
        "Failed to get method",
        instance: instance,
        method_name: method_name,
      ) do
        instance.method method_name
      end
    end
  end
202275
def target=(target)
      if target.is_a? Symbol
        target = Object.const_get(target.to_s.upcase)
      end

      initialize(target, @level)
    end
514022
@JRubyMethod
    public static IRubyObject initialize(IRubyObject self, IRubyObject val) {
        ((RubyObject)self).fastSetInstanceVariable("@name", val);
        return self;
    }
893567
def handle_target(self, request, controller_args, controller_kwargs):
        
        self.request = request
        super(AuthDecorator, self).handle_target(request, controller_args, controller_kwargs)
        del self.request
752791
def define_instance_getter
        name = @name
        options = @options

        @klass.send :define_method, @name do |*args|
          ivar = "@attachment_#{name}"
          attachment = instance_variable_get(ivar)

          if attachment.nil?
            attachment = Attachment.new(name, self, options)
            instance_variable_set(ivar, attachment)
          end

          if args.length > 0
            attachment.to_s(args.first)
          else
            attachment
          end
        end
      end
396624
def get(req)
    target_uri = req.header.request_uri
    param = Util.hash_find_value(@challenge) { |uri, param|
      Util.uri_part_of(target_uri, uri)
    }
    return nil unless param
    user, passwd = Util.hash_find_value(@auth) { |uri, auth_data|
      Util.uri_part_of(target_uri, uri)
    }
    return nil unless user
    uri = req.header.request_uri
    calc_cred(req.header.request_method, uri, user, passwd, param)
  end