Class: Munna::Proxy::Execute
- Inherits:
-
Object
- Object
- Munna::Proxy::Execute
- Defined in:
- lib/munna/proxy/execute.rb
Instance Method Summary collapse
-
#initialize(target, object = {}) ⇒ Execute
constructor
A new instance of Execute.
- #name ⇒ Object
- #value ⇒ Object
Constructor Details
#initialize(target, object = {}) ⇒ Execute
Returns a new instance of Execute.
4 5 6 7 |
# File 'lib/munna/proxy/execute.rb', line 4 def initialize(target, object={}) @target = target @object = object end |
Instance Method Details
#name ⇒ Object
9 10 11 |
# File 'lib/munna/proxy/execute.rb', line 9 def name @object.is_a?(Proc) ? nil : @object[:name] end |
#value ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/munna/proxy/execute.rb', line 13 def value @value ||= if @object.is_a? Proc @object.call else @target.send @object[:name], *@object[:params] end end |