Class: Seiun::Callback::RecordWrapper
- Inherits:
-
Object
- Object
- Seiun::Callback::RecordWrapper
- Defined in:
- lib/seiun/callback/record_wrapper.rb
Instance Method Summary collapse
-
#initialize(record) ⇒ RecordWrapper
constructor
A new instance of RecordWrapper.
- #to_hash ⇒ Object
Constructor Details
#initialize(record) ⇒ RecordWrapper
Returns a new instance of RecordWrapper.
4 5 6 |
# File 'lib/seiun/callback/record_wrapper.rb', line 4 def initialize(record) @record = record end |
Instance Method Details
#to_hash ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/seiun/callback/record_wrapper.rb', line 8 def to_hash if callback_defined?(:hashalize) @record.__send__(:hashalize) elsif @record.respond_to?(:to_hash) @record.to_hash else @record end end |