Class: Mork::Raw::Table

Inherits:
Object
  • Object
show all
Defined in:
lib/mork/raw/table.rb

Overview

A table of rows

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(raw_id:, values:) ⇒ Table

Returns a new instance of Table.



15
16
17
18
# File 'lib/mork/raw/table.rb', line 15

def initialize(raw_id:, values:)
  @raw_id = raw_id
  @values = values
end

Instance Attribute Details

#raw_idObject (readonly)

Returns the value of attribute raw_id.



12
13
14
# File 'lib/mork/raw/table.rb', line 12

def raw_id
  @raw_id
end

#valuesObject (readonly)

Returns the value of attribute values.



13
14
15
# File 'lib/mork/raw/table.rb', line 13

def values
  @values
end

Instance Method Details

#resolve(dictionaries:) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/mork/raw/table.rb', line 24

def resolve(dictionaries:)
  resolved_id = resolve_id(dictionaries)
  Resolved::Table.new(
    action: resolved_id.action, namespace: resolved_id.namespace, id: resolved_id.id,
    rows: resolved_rows(dictionaries)
  )
end

#rowsObject



20
21
22
# File 'lib/mork/raw/table.rb', line 20

def rows
  values.filter { |c| c.is_a?(Raw::Row) }
end