Class: ConvenientService::Utils::Proc::ExecConfig
- Inherits:
-
Support::Command
- Object
- Support::Command
- ConvenientService::Utils::Proc::ExecConfig
- Defined in:
- lib/convenient_service/utils/proc/exec_config.rb
Instance Attribute Summary collapse
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#proc ⇒ Object
readonly
Returns the value of attribute proc.
Instance Method Summary collapse
-
#call ⇒ Object
Can be any type.
- #initialize(proc, object) ⇒ void constructor
Methods inherited from Support::Command
Constructor Details
#initialize(proc, object) ⇒ void
24 25 26 27 |
# File 'lib/convenient_service/utils/proc/exec_config.rb', line 24 def initialize(proc, object) @proc = proc @object = object end |
Instance Attribute Details
#object ⇒ Object (readonly)
Returns the value of attribute object.
11 12 13 |
# File 'lib/convenient_service/utils/proc/exec_config.rb', line 11 def object @object end |
#proc ⇒ Object (readonly)
Returns the value of attribute proc.
17 18 19 |
# File 'lib/convenient_service/utils/proc/exec_config.rb', line 17 def proc @proc end |
Instance Method Details
#call ⇒ Object
Note:
Second form allows to access methods from the enclosing context (like test
in examples).
Returns Can be any type.
71 72 73 |
# File 'lib/convenient_service/utils/proc/exec_config.rb', line 71 def call proc_has_one_positional_argument? ? proc.call(object) : object.instance_exec(&proc) end |