Class: Cloudsheet::Sheet

Inherits:
Object
  • Object
show all
Defined in:
lib/cloudsheet/sheet.rb

Direct Known Subclasses

Drive

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#raw_sheetObject (readonly)

Returns the value of attribute raw_sheet.



7
8
9
# File 'lib/cloudsheet/sheet.rb', line 7

def raw_sheet
  @raw_sheet
end

#workbookObject (readonly)

Returns the value of attribute workbook.



7
8
9
# File 'lib/cloudsheet/sheet.rb', line 7

def workbook
  @workbook
end

Instance Method Details

#eachObject



14
15
16
17
18
# File 'lib/cloudsheet/sheet.rb', line 14

def each
  rows.each do |r|
    yield Row.parse(r, @map)
  end
end

#map(m) ⇒ Object



9
10
11
12
# File 'lib/cloudsheet/sheet.rb', line 9

def map(m)
  @map = m
  self
end

#rowsObject



20
21
22
# File 'lib/cloudsheet/sheet.rb', line 20

def rows
  @raw_sheet.rows
end

#sheet(num) ⇒ Object



24
25
26
27
# File 'lib/cloudsheet/sheet.rb', line 24

def sheet(num)
  @raw_sheet = @workbook[num]
  self
end