Class: CsvRecord::Callback
Instance Attribute Summary collapse
-
#code ⇒ Object
Returns the value of attribute code.
-
#kind ⇒ Object
Returns the value of attribute kind.
Instance Method Summary collapse
-
#initialize(kind, code) ⇒ Callback
constructor
A new instance of Callback.
- #run_on(obj) ⇒ Object
Constructor Details
#initialize(kind, code) ⇒ Callback
4 5 6 7 |
# File 'lib/csv_record/callback.rb', line 4 def initialize(kind, code) self.kind = kind self.code = code end |
Instance Attribute Details
#code ⇒ Object
Returns the value of attribute code.
2 3 4 |
# File 'lib/csv_record/callback.rb', line 2 def code @code end |
#kind ⇒ Object
Returns the value of attribute kind.
2 3 4 |
# File 'lib/csv_record/callback.rb', line 2 def kind @kind end |
Instance Method Details
#run_on(obj) ⇒ Object
9 10 11 |
# File 'lib/csv_record/callback.rb', line 9 def run_on(obj) obj.instance_eval &self.code end |