Class: Mork::Raw::Dictionary
- Inherits:
-
Object
- Object
- Mork::Raw::Dictionary
- Defined in:
- lib/mork/raw/dictionary.rb
Overview
A key-value mapping with a namespace (“scope”)
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
-
#initialize(values:) ⇒ Dictionary
constructor
A new instance of Dictionary.
-
#scope ⇒ Object
a - “Atom” - the data c - “Column” - the column name.
- #to_h ⇒ Object
Constructor Details
#initialize(values:) ⇒ Dictionary
Returns a new instance of Dictionary.
13 14 15 |
# File 'lib/mork/raw/dictionary.rb', line 13 def initialize(values:) @values = values end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
11 12 13 |
# File 'lib/mork/raw/dictionary.rb', line 11 def values @values end |
Instance Method Details
#scope ⇒ Object
a - “Atom” - the data c - “Column” - the column name
23 24 25 |
# File 'lib/mork/raw/dictionary.rb', line 23 def scope &.scope || "a" end |
#to_h ⇒ Object
17 18 19 |
# File 'lib/mork/raw/dictionary.rb', line 17 def to_h aliases.each.with_object({}) { |a, acc| acc[a.key] = a.value } end |