Class: Contracted::Json::Object
- Inherits:
-
Object
- Object
- Contracted::Json::Object
- Defined in:
- lib/contracted/json.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(elements) ⇒ Object
constructor
A new instance of Object.
Constructor Details
#initialize(elements) ⇒ Object
14 15 16 17 |
# File 'lib/contracted/json.rb', line 14 def initialize elements @hash = elements.select {|e| e != Wildcard.instance }.inject({}) {|r, h| r.merge(h)} @include = elements.include? Wildcard.instance end |
Instance Method Details
#==(other) ⇒ Object
19 20 21 22 23 24 25 |
# File 'lib/contracted/json.rb', line 19 def == other if @include other.merge(@hash) == other else @hash == other end end |