Class: Extract::Tables

Inherits:
Object show all
Includes:
FromHash
Defined in:
lib/extract/tables.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#sheet_defObject

Returns the value of attribute sheet_def.



4
5
6
# File 'lib/extract/tables.rb', line 4

def sheet_def
  @sheet_def
end

Instance Method Details

#[](c) ⇒ Object



25
26
27
28
29
30
31
# File 'lib/extract/tables.rb', line 25

def [](c)
  if c.to_s == 'all'
    Table.new(:cell_range => "A1:D100", :name => "all", :sheet_def => sheet_def)
  else
    tables[c]
  end
end

#add(name, range) ⇒ Object



7
8
9
# File 'lib/extract/tables.rb', line 7

def add(name,range)
  self.tables[name] = Table.new(:cell_range => range, :name => name, :sheet_def => sheet_def)
end

#each(&b) ⇒ Object



32
33
34
# File 'lib/extract/tables.rb', line 32

def each(&b)
  tables.each(&b)
end

#for_cell(c) ⇒ Object



21
22
23
# File 'lib/extract/tables.rb', line 21

def for_cell(c)
  cell_map[c]
end

#valuesObject



35
36
37
# File 'lib/extract/tables.rb', line 35

def values
  tables.values
end