Class: Mork::Resolved::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/mork/resolved/row.rb

Overview

A resolved Row

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(action:, namespace:, id:, cells:) ⇒ Row

Returns a new instance of Row.



13
14
15
16
17
18
# File 'lib/mork/resolved/row.rb', line 13

def initialize(action:, namespace:, id:, cells:)
  @action = action
  @namespace = namespace
  @id = id
  @cells = cells
end

Instance Attribute Details

#actionObject (readonly)

Returns the value of attribute action.



8
9
10
# File 'lib/mork/resolved/row.rb', line 8

def action
  @action
end

#cellsObject (readonly)

Returns the value of attribute cells.



11
12
13
# File 'lib/mork/resolved/row.rb', line 11

def cells
  @cells
end

#idObject (readonly)

Returns the value of attribute id.



10
11
12
# File 'lib/mork/resolved/row.rb', line 10

def id
  @id
end

#namespaceObject (readonly)

Returns the value of attribute namespace.



9
10
11
# File 'lib/mork/resolved/row.rb', line 9

def namespace
  @namespace
end

Instance Method Details

#to_hObject



20
21
22
23
24
25
# File 'lib/mork/resolved/row.rb', line 20

def to_h
  cells.
    each.with_object({}) do |cell, acc|
    acc[cell.key] = cell.value
  end
end