Class: Mork::Raw
- Inherits:
-
Object
- Object
- Mork::Raw
- Defined in:
- lib/mork/raw.rb,
lib/mork/raw/id.rb,
lib/mork/raw/row.rb,
lib/mork/raw/cell.rb,
lib/mork/raw/alias.rb,
lib/mork/raw/group.rb,
lib/mork/raw/table.rb,
lib/mork/raw/dictionary.rb,
lib/mork/raw/meta_alias.rb,
lib/mork/raw/meta_table.rb
Overview
rubocop:disable Lint/EmptyClass
Defined Under Namespace
Classes: Alias, Cell, Dictionary, Group, Id, MetaAlias, MetaTable, Row, Table
Instance Attribute Summary collapse
-
#values ⇒ Object
readonly
Returns the value of attribute values.
Instance Method Summary collapse
- #data ⇒ Object
-
#dictionaries ⇒ Object
build a Hash of scopes (usually “a” and “c”) each value being a Hash of key-value entries.
-
#initialize(values:) ⇒ Raw
constructor
A new instance of Raw.
Constructor Details
#initialize(values:) ⇒ Raw
Returns a new instance of Raw.
12 13 14 |
# File 'lib/mork/raw.rb', line 12 def initialize(values:) @values = values end |
Instance Attribute Details
#values ⇒ Object (readonly)
Returns the value of attribute values.
10 11 12 |
# File 'lib/mork/raw.rb', line 10 def values @values end |
Instance Method Details
#data ⇒ Object
27 28 29 30 31 32 |
# File 'lib/mork/raw.rb', line 27 def data Data.new( rows: resolved_rows(dictionaries), tables: resolved_tables(dictionaries) ) end |
#dictionaries ⇒ Object
build a Hash of scopes (usually “a” and “c”) each value being a Hash of key-value entries
18 19 20 21 22 23 24 25 |
# File 'lib/mork/raw.rb', line 18 def dictionaries @dictionaries ||= raw_dictionaries.each.with_object({}) do |d, scopes| scope = d.scope scopes[scope] ||= {} scopes[scope].merge!(d.to_h) end end |