Class: Lutaml::Model::JsonAdapter::JsonObject

Inherits:
Object
  • Object
show all
Defined in:
lib/lutaml/model/json_adapter.rb

Direct Known Subclasses

Document

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#attributesObject (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_hObject



22
23
24
# File 'lib/lutaml/model/json_adapter.rb', line 22

def to_h
  @attributes
end