Module: Ohm::ToHash
- Defined in:
- lib/ohm/contrib/to_hash.rb
Overview
TODO:
use super when Ohm has finally release their #to_hash impl.
Ohm has already added its own `to_hash` method. The difference is that it chose the albeit better whitelisted approach.
Instance Method Summary (collapse)
- - (Object) to_hash (also: #to_h)
Instance Method Details
- (Object) to_hash Also known as: to_h
31 32 33 34 35 36 |
# File 'lib/ohm/contrib/to_hash.rb', line 31 def to_hash atts = attributes + counters hash = atts.inject({}) { |h, att| h[att] = send(att); h } hash[:id] = @id hash end |