Class: SerialScheduler::Dsl::CallWrapper
- Inherits:
-
Object
- Object
- SerialScheduler::Dsl::CallWrapper
- Defined in:
- lib/serial_scheduler/dsl.rb
Instance Attribute Summary collapse
-
#callee ⇒ Object
readonly
Returns the value of attribute callee.
-
#meth ⇒ Object
readonly
Returns the value of attribute meth.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(callee, meth) ⇒ CallWrapper
constructor
A new instance of CallWrapper.
- #to_s ⇒ Object
Constructor Details
#initialize(callee, meth) ⇒ CallWrapper
Returns a new instance of CallWrapper.
5 6 7 8 |
# File 'lib/serial_scheduler/dsl.rb', line 5 def initialize(callee, meth) @callee = callee @meth = meth end |
Instance Attribute Details
#callee ⇒ Object (readonly)
Returns the value of attribute callee.
4 5 6 |
# File 'lib/serial_scheduler/dsl.rb', line 4 def callee @callee end |
#meth ⇒ Object (readonly)
Returns the value of attribute meth.
4 5 6 |
# File 'lib/serial_scheduler/dsl.rb', line 4 def meth @meth end |
Instance Method Details
#call ⇒ Object
10 11 12 13 |
# File 'lib/serial_scheduler/dsl.rb', line 10 def call instance_to_call = callee.kind_of?(String) ? callee.constantize : callee instance_to_call.send(meth) end |
#to_s ⇒ Object
15 16 17 |
# File 'lib/serial_scheduler/dsl.rb', line 15 def to_s "#{callee}.#{meth}" end |