Class: JSON::SchemaBuilder::RSpecHelper::DeepOpenStruct
- Inherits:
-
OpenStruct
- Object
- OpenStruct
- JSON::SchemaBuilder::RSpecHelper::DeepOpenStruct
- Defined in:
- lib/json/schema_builder/rspec_helper/deep_open_struct.rb
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
-
#initialize(hash = { }) ⇒ DeepOpenStruct
constructor
A new instance of DeepOpenStruct.
- #inspect ⇒ Object
Constructor Details
#initialize(hash = { }) ⇒ DeepOpenStruct
Returns a new instance of DeepOpenStruct.
5 6 7 8 9 10 11 12 |
# File 'lib/json/schema_builder/rspec_helper/deep_open_struct.rb', line 5 def initialize(hash = { }) @table = { } hash.each_pair do |key, value| key = key.to_sym @table[key] = _transform value new_ostruct_member key end end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
14 15 16 |
# File 'lib/json/schema_builder/rspec_helper/deep_open_struct.rb', line 14 def ==(other) to_h == other.to_h end |
#inspect ⇒ Object
19 20 21 |
# File 'lib/json/schema_builder/rspec_helper/deep_open_struct.rb', line 19 def inspect to_h.inspect end |