Class: Pinkman::FormHelper::Dispatcher

Inherits:
Object
  • Object
show all
Defined in:
lib/pinkman/form_helper.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ Dispatcher

Returns a new instance of Dispatcher.



9
10
11
# File 'lib/pinkman/form_helper.rb', line 9

def initialize value
  @rails_helper = value
end

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



13
14
15
16
17
18
19
20
21
22
23
# File 'lib/pinkman/form_helper.rb', line 13

def method_missing m, *args, &block
  if Pinkman::FormHelper.respond_to?(m)
    if block_given?
      rails_helper.instance_exec(*args,block,&Pinkman::FormHelper.send(m))
    else
      rails_helper.instance_exec(*args,&Pinkman::FormHelper.send(m))
    end
  else
    super(m)
  end
end

Instance Attribute Details

#rails_helperObject

Returns the value of attribute rails_helper.



7
8
9
# File 'lib/pinkman/form_helper.rb', line 7

def rails_helper
  @rails_helper
end