Class: Transformers::MethodCall
- Inherits:
-
Object
- Object
- Transformers::MethodCall
- Defined in:
- lib/transformers/method_call.rb
Instance Attribute Summary collapse
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
- #==(other) ⇒ Object
- #call(value) ⇒ Object
-
#initialize(name) ⇒ MethodCall
constructor
A new instance of MethodCall.
Constructor Details
#initialize(name) ⇒ MethodCall
Returns a new instance of MethodCall.
5 6 7 |
# File 'lib/transformers/method_call.rb', line 5 def initialize(name) @name = name end |
Instance Attribute Details
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/transformers/method_call.rb', line 3 def name @name end |
Instance Method Details
#==(other) ⇒ Object
13 14 15 |
# File 'lib/transformers/method_call.rb', line 13 def ==(other) self.name.to_s == other.name.to_s end |
#call(value) ⇒ Object
9 10 11 |
# File 'lib/transformers/method_call.rb', line 9 def call(value) value.send(self.name) end |