Class: Lutaml::KeyValue::Document
- Inherits:
-
Object
- Object
- Lutaml::KeyValue::Document
show all
- Defined in:
- lib/lutaml/key_value/document.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(attributes = {}, register: nil) ⇒ Document
6
7
8
9
|
# File 'lib/lutaml/key_value/document.rb', line 6
def initialize(attributes = {}, register: nil)
@attributes = attributes
@register = register || Lutaml::Model::Config.default_register
end
|
Instance Attribute Details
#attributes ⇒ Object
Returns the value of attribute attributes.
4
5
6
|
# File 'lib/lutaml/key_value/document.rb', line 4
def attributes
@attributes
end
|
#register ⇒ Object
Returns the value of attribute register.
4
5
6
|
# File 'lib/lutaml/key_value/document.rb', line 4
def register
@register
end
|
Instance Method Details
#[](key) ⇒ Object
11
12
13
|
# File 'lib/lutaml/key_value/document.rb', line 11
def [](key)
@attributes[key]
end
|
#[]=(key, value) ⇒ Object
15
16
17
|
# File 'lib/lutaml/key_value/document.rb', line 15
def []=(key, value)
@attributes[key] = value
end
|
#key?(key) ⇒ Boolean
19
20
21
|
# File 'lib/lutaml/key_value/document.rb', line 19
def key?(key)
@attributes.key?(key)
end
|
#to_h ⇒ Object
23
24
25
|
# File 'lib/lutaml/key_value/document.rb', line 23
def to_h
@attributes
end
|