Sha256: 13d2891c895628ace61179adf9765464d8e40567f6dab7655059b2e14015700f

Contents?: true

Size: 217 Bytes

Versions: 10

Compression:

Stored size: 217 Bytes

Contents

module Ohm
  module ToHash
    def to_hash
      atts = attributes + counters
      hash = atts.inject({}) { |h, att| h[att] = send(att); h }
      hash[:id] = @id
      hash
    end
    alias :to_h :to_hash
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ohm-contrib-0.0.14 lib/ohm/contrib/to_hash.rb
ohm-contrib-0.0.13 lib/ohm/contrib/to_hash.rb
ohm-contrib-0.0.12 lib/ohm/contrib/to_hash.rb
ohm-contrib-0.0.11 lib/ohm/contrib/to_hash.rb
ohm-contrib-0.0.10 lib/ohm/contrib/to_hash.rb
ohm-contrib-0.0.9 lib/ohm/contrib/to_hash.rb
ohm-contrib-0.0.8 lib/ohm/contrib/to_hash.rb
ohm-contrib-0.0.7 lib/ohm/contrib/to_hash.rb
ohm-contrib-0.0.6 lib/ohm/contrib/to_hash.rb
ohm-contrib-0.0.5 lib/ohm/contrib/to_hash.rb