Class: Lutaml::Model::KeyValueDocument

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(attributes = {}) ⇒ KeyValueDocument

Returns a new instance of KeyValueDocument.



6
7
8
# File 'lib/lutaml/model/key_value_document.rb', line 6

def initialize(attributes = {})
  @attributes = attributes
end

Instance Attribute Details

#attributesObject (readonly)

Returns the value of attribute attributes.



4
5
6
# File 'lib/lutaml/model/key_value_document.rb', line 4

def attributes
  @attributes
end

Instance Method Details

#[](key) ⇒ Object



10
11
12
# File 'lib/lutaml/model/key_value_document.rb', line 10

def [](key)
  @attributes[key]
end

#[]=(key, value) ⇒ Object



14
15
16
# File 'lib/lutaml/model/key_value_document.rb', line 14

def []=(key, value)
  @attributes[key] = value
end

#key?(key) ⇒ Boolean

Returns:

  • (Boolean)


18
19
20
# File 'lib/lutaml/model/key_value_document.rb', line 18

def key?(key)
  @attributes.key?(key)
end

#to_hObject



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

def to_h
  @attributes
end