Class: MergeExcel::Sheet
- Inherits:
-
Object
- Object
- MergeExcel::Sheet
- Defined in:
- lib/merge_excel/sheet.rb
Instance Attribute Summary collapse
-
#book ⇒ Object
readonly
Returns the value of attribute book.
-
#data_rows ⇒ Object
readonly
Returns the value of attribute data_rows.
-
#header ⇒ Object
readonly
Returns the value of attribute header.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
-
#sheet_idx ⇒ Object
readonly
Returns the value of attribute sheet_idx.
-
#source_sheet ⇒ Object
readonly
Returns the value of attribute source_sheet.
-
#source_sheet_idx ⇒ Object
readonly
Returns the value of attribute source_sheet_idx.
Instance Method Summary collapse
- #add_data_row(array, extra_data, book) ⇒ Object
- #add_header(array, extra_data) ⇒ Object
-
#initialize(source_sheet, source_sheet_idx) ⇒ Sheet
constructor
A new instance of Sheet.
Constructor Details
#initialize(source_sheet, source_sheet_idx) ⇒ Sheet
Returns a new instance of Sheet.
4 5 6 7 8 9 10 11 12 |
# File 'lib/merge_excel/sheet.rb', line 4 def initialize(source_sheet, source_sheet_idx) @source_sheet = source_sheet @source_sheet_idx = source_sheet_idx @name = @source_sheet.sheet_name @book = @source_sheet.workbook @header = nil @data_rows = [] end |
Instance Attribute Details
#book ⇒ Object (readonly)
Returns the value of attribute book.
3 4 5 |
# File 'lib/merge_excel/sheet.rb', line 3 def book @book end |
#data_rows ⇒ Object (readonly)
Returns the value of attribute data_rows.
3 4 5 |
# File 'lib/merge_excel/sheet.rb', line 3 def data_rows @data_rows end |
#header ⇒ Object (readonly)
Returns the value of attribute header.
3 4 5 |
# File 'lib/merge_excel/sheet.rb', line 3 def header @header end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
3 4 5 |
# File 'lib/merge_excel/sheet.rb', line 3 def name @name end |
#sheet_idx ⇒ Object (readonly)
Returns the value of attribute sheet_idx.
3 4 5 |
# File 'lib/merge_excel/sheet.rb', line 3 def sheet_idx @sheet_idx end |
#source_sheet ⇒ Object (readonly)
Returns the value of attribute source_sheet.
3 4 5 |
# File 'lib/merge_excel/sheet.rb', line 3 def source_sheet @source_sheet end |
#source_sheet_idx ⇒ Object (readonly)
Returns the value of attribute source_sheet_idx.
3 4 5 |
# File 'lib/merge_excel/sheet.rb', line 3 def source_sheet_idx @source_sheet_idx end |
Instance Method Details
#add_data_row(array, extra_data, book) ⇒ Object
18 19 20 |
# File 'lib/merge_excel/sheet.rb', line 18 def add_data_row(array, extra_data, book) @data_rows << DataRow.new(array || [], extra_data, book).array end |
#add_header(array, extra_data) ⇒ Object
14 15 16 |
# File 'lib/merge_excel/sheet.rb', line 14 def add_header(array, extra_data) @header = Header.new(array, extra_data) end |