Class: Portable::Modeling::Sheet
- Inherits:
-
Object
- Object
- Portable::Modeling::Sheet
- Extended by:
- Forwardable
- Defined in:
- lib/portable/modeling/sheet.rb
Overview
Abstract concept modeling for the notion of a “sheet” in a “document”. This means different things given the writer. For example, all writers should support multiple sheets but there is no internal representation of a “sheet” within a CSV, so each sheet will emit one file.
Instance Attribute Summary collapse
-
#data_source_name ⇒ Object
readonly
Returns the value of attribute data_source_name.
-
#data_table ⇒ Object
readonly
Returns the value of attribute data_table.
-
#footer_rows ⇒ Object
readonly
Returns the value of attribute footer_rows.
-
#header_rows ⇒ Object
readonly
Returns the value of attribute header_rows.
-
#name ⇒ Object
readonly
Returns the value of attribute name.
Instance Method Summary collapse
-
#initialize(data_source_name: '', data_table: nil, footer_rows: [], header_rows: [], name: '') ⇒ Sheet
constructor
A new instance of Sheet.
Constructor Details
#initialize(data_source_name: '', data_table: nil, footer_rows: [], header_rows: [], name: '') ⇒ Sheet
Returns a new instance of Sheet.
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
# File 'lib/portable/modeling/sheet.rb', line 33 def initialize( data_source_name: '', data_table: nil, footer_rows: [], header_rows: [], name: '' ) @data_source_name = decide_data_source_name(data_source_name, name) @name = name.to_s @data_table = DataTable.make(data_table, nullable: false) @footer_rows = || [] @header_rows = header_rows || [] freeze end |
Instance Attribute Details
#data_source_name ⇒ Object (readonly)
Returns the value of attribute data_source_name.
27 28 29 |
# File 'lib/portable/modeling/sheet.rb', line 27 def data_source_name @data_source_name end |
#data_table ⇒ Object (readonly)
Returns the value of attribute data_table.
27 28 29 |
# File 'lib/portable/modeling/sheet.rb', line 27 def data_table @data_table end |
#footer_rows ⇒ Object (readonly)
Returns the value of attribute footer_rows.
27 28 29 |
# File 'lib/portable/modeling/sheet.rb', line 27 def @footer_rows end |
#header_rows ⇒ Object (readonly)
Returns the value of attribute header_rows.
27 28 29 |
# File 'lib/portable/modeling/sheet.rb', line 27 def header_rows @header_rows end |
#name ⇒ Object (readonly)
Returns the value of attribute name.
27 28 29 |
# File 'lib/portable/modeling/sheet.rb', line 27 def name @name end |