Class: BerkeleyLibrary::TIND::Export::Row

Inherits:
Object
  • Object
show all
Defined in:
lib/berkeley_library/tind/export/row.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(columns, row_index) ⇒ Row

Returns a new instance of Row.



9
10
11
12
# File 'lib/berkeley_library/tind/export/row.rb', line 9

def initialize(columns, row_index)
  @columns = columns
  @row_index = row_index
end

Instance Attribute Details

#columnsObject (readonly)

Returns the value of attribute columns.



6
7
8
# File 'lib/berkeley_library/tind/export/row.rb', line 6

def columns
  @columns
end

#row_indexObject (readonly)

Returns the value of attribute row_index.



7
8
9
# File 'lib/berkeley_library/tind/export/row.rb', line 7

def row_index
  @row_index
end

Instance Method Details

#each_value(&block) ⇒ Object



18
19
20
# File 'lib/berkeley_library/tind/export/row.rb', line 18

def each_value(&block)
  columns.map { |c| c.value_at(row_index) }.each(&block)
end

#valuesObject



14
15
16
# File 'lib/berkeley_library/tind/export/row.rb', line 14

def values
  columns.map { |c| c.value_at(row_index) }
end