Class: MongoidForm::WrapperConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/mongoid_form/wrapper_config.rb

Instance Method Summary collapse

Constructor Details

#initialize(&block) ⇒ WrapperConfig

Returns a new instance of WrapperConfig.



4
5
6
# File 'lib/mongoid_form/wrapper_config.rb', line 4

def initialize(&block)
  instance_eval &block
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(meth, *args, &block) ⇒ Object



8
9
10
11
12
13
14
# File 'lib/mongoid_form/wrapper_config.rb', line 8

def method_missing meth, *args, &block
  if instance_variable_defined? "@#{meth}"
    instance_variable_get "@#{meth}"
  else
    instance_variable_set "@#{meth}", args
  end
end