Class: EacRubyUtils::MethodClass::Setup

Inherits:
Object
  • Object
show all
Defined in:
lib/eac_ruby_utils/method_class.rb

Instance Method Summary collapse

Instance Method Details

#method_nameObject



26
27
28
# File 'lib/eac_ruby_utils/method_class.rb', line 26

def method_name
  method_class.name.demodulize.underscore.variableize
end

#performObject



19
20
21
22
23
24
# File 'lib/eac_ruby_utils/method_class.rb', line 19

def perform
  the_setup = self
  sender_module.define_method(method_name) do |*args, &block|
    the_setup.method_class.new(self, *args, &block).result
  end
end

#sender_moduleObject



30
31
32
# File 'lib/eac_ruby_utils/method_class.rb', line 30

def sender_module
  method_class.module_parent
end