Module: Resourced::Finders::InstanceMethods

Defined in:
lib/resourced/finders.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#findersObject (readonly)

Returns the value of attribute finders.



45
46
47
# File 'lib/resourced/finders.rb', line 45

def finders
  @finders
end

Instance Method Details

#apply_findersObject



47
48
49
50
51
52
53
54
55
56
57
58
# File 'lib/resourced/finders.rb', line 47

def apply_finders
  defaults = self.class.instance_variable_get(:@_default_finders)
  defaults.each do |finder|
    @chain = self.instance_eval(&finder)
  end

  @finders.each_pair do |key, value|
    @chain = self.instance_exec(value, &@finders_obj.finders[key.to_sym])
  end

  return self
end

#initialize(params, scope) ⇒ Object



40
41
42
43
44
# File 'lib/resourced/finders.rb', line 40

def initialize(params, scope)
  super
  @finders_obj = self.class.instance_variable_get(:@_finders_obj)
  @finders = @finders_obj.sanitize_params(self, params)
end