Class: Lutaml::Model::JsonAdapter::JsonObject
- Inherits:
-
Object
- Object
- Lutaml::Model::JsonAdapter::JsonObject
- Defined in:
- lib/lutaml/model/json_adapter.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#attributes ⇒ Object
readonly
Returns the value of attribute attributes.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, value) ⇒ Object
-
#initialize(attributes = {}) ⇒ JsonObject
constructor
A new instance of JsonObject.
- #to_h ⇒ Object
Constructor Details
#initialize(attributes = {}) ⇒ JsonObject
Returns a new instance of JsonObject.
10 11 12 |
# File 'lib/lutaml/model/json_adapter.rb', line 10 def initialize(attributes = {}) @attributes = attributes end |
Instance Attribute Details
#attributes ⇒ Object (readonly)
Returns the value of attribute attributes.
8 9 10 |
# File 'lib/lutaml/model/json_adapter.rb', line 8 def attributes @attributes end |
Instance Method Details
#[](key) ⇒ Object
14 15 16 |
# File 'lib/lutaml/model/json_adapter.rb', line 14 def [](key) @attributes[key] end |
#[]=(key, value) ⇒ Object
18 19 20 |
# File 'lib/lutaml/model/json_adapter.rb', line 18 def []=(key, value) @attributes[key] = value end |
#to_h ⇒ Object
22 23 24 |
# File 'lib/lutaml/model/json_adapter.rb', line 22 def to_h @attributes end |