Module: ObjectsFramework::AutoParams

Defined in:
lib/objectsframework/autoparams.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.included(child) ⇒ Object



3
4
5
# File 'lib/objectsframework/autoparams.rb', line 3

def self.included(child)
  child.add_hook(:filter => "object.before_execute", :method => "autoparams_create_instance_methods")
end

Instance Method Details

#autoparams_create_instance_methodsObject



7
8
9
10
11
# File 'lib/objectsframework/autoparams.rb', line 7

def autoparams_create_instance_methods
  request.params.each_pair do |key,value|
    self.define_singleton_method key, lambda {value}
  end
end