Class: Retab::SheetRegion

Inherits:
Types::BaseModel
  • Object
show all
Defined in:
lib/retab/splits/sheet_region.rb

Constant Summary collapse

HASH_ATTRS =
{
  col_end: :col_end,
  col_start: :col_start,
  header_rows: :header_rows,
  row_end: :row_end,
  row_start: :row_start,
  sheet_index: :sheet_index,
  sheet_name: :sheet_name
}.freeze

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(json) ⇒ SheetRegion

Returns a new instance of SheetRegion.



28
29
30
31
32
33
34
35
36
37
38
# File 'lib/retab/splits/sheet_region.rb', line 28

def initialize(json)
  super()
  hash = self.class.normalize(json)
  @col_end = hash[:col_end]
  @col_start = hash[:col_start]
  @header_rows = (hash[:header_rows] || [])
  @row_end = hash[:row_end]
  @row_start = hash[:row_start]
  @sheet_index = hash[:sheet_index]
  @sheet_name = hash[:sheet_name]
end

Instance Attribute Details

#col_endObject

Returns the value of attribute col_end.



18
19
20
# File 'lib/retab/splits/sheet_region.rb', line 18

def col_end
  @col_end
end

#col_startObject

Returns the value of attribute col_start.



18
19
20
# File 'lib/retab/splits/sheet_region.rb', line 18

def col_start
  @col_start
end

#header_rowsObject

Returns the value of attribute header_rows.



18
19
20
# File 'lib/retab/splits/sheet_region.rb', line 18

def header_rows
  @header_rows
end

#row_endObject

Returns the value of attribute row_end.



18
19
20
# File 'lib/retab/splits/sheet_region.rb', line 18

def row_end
  @row_end
end

#row_startObject

Returns the value of attribute row_start.



18
19
20
# File 'lib/retab/splits/sheet_region.rb', line 18

def row_start
  @row_start
end

#sheet_indexObject

Returns the value of attribute sheet_index.



18
19
20
# File 'lib/retab/splits/sheet_region.rb', line 18

def sheet_index
  @sheet_index
end

#sheet_nameObject

Returns the value of attribute sheet_name.



18
19
20
# File 'lib/retab/splits/sheet_region.rb', line 18

def sheet_name
  @sheet_name
end