Class: Pantry::DryGood
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- Pantry::DryGood
- Includes:
- ActiveModel::Serialization
- Defined in:
- lib/pantry/dry_good.rb
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#as_json(options = nil) ⇒ Object
OpenStruct objects don’t turn into hashes wrapped in a ‘table’ key goo.gl/vPjtgz.
-
#attributes ⇒ Object
Implements required interface method for ActiveModel::Serialization.
- #hash ⇒ Object
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
10 11 12 |
# File 'lib/pantry/dry_good.rb', line 10 def ==(other) super end |
#as_json(options = nil) ⇒ Object
OpenStruct objects don’t turn into hashes wrapped in a ‘table’ key goo.gl/vPjtgz
20 21 22 |
# File 'lib/pantry/dry_good.rb', line 20 def as_json( = nil) @table.as_json() end |
#attributes ⇒ Object
Implements required interface method for ActiveModel::Serialization.
6 7 8 |
# File 'lib/pantry/dry_good.rb', line 6 def attributes to_h.deep_stringify_keys end |
#hash ⇒ Object
14 15 16 |
# File 'lib/pantry/dry_good.rb', line 14 def hash super end |