Class: ExcelWalker::Writer::Cells
- Inherits:
-
Object
- Object
- ExcelWalker::Writer::Cells
- Defined in:
- lib/excel_walker/writer/cells.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
Returns the value of attribute data.
-
#default_style ⇒ Object
Returns the value of attribute default_style.
-
#styles ⇒ Object
Returns the value of attribute styles.
-
#width ⇒ Object
Returns the value of attribute width.
Instance Method Summary collapse
- #build ⇒ Object
-
#initialize(default_style) ⇒ Cells
constructor
A new instance of Cells.
- #set_data_at(range, cell_data) ⇒ Object
- #set_style_at(range, cell_style) ⇒ Object
Constructor Details
#initialize(default_style) ⇒ Cells
Returns a new instance of Cells.
7 8 9 10 |
# File 'lib/excel_walker/writer/cells.rb', line 7 def initialize(default_style) @default_style = default_style @data, @styles, @width = [], [], 0 end |
Instance Attribute Details
#data ⇒ Object
Returns the value of attribute data.
5 6 7 |
# File 'lib/excel_walker/writer/cells.rb', line 5 def data @data end |
#default_style ⇒ Object
Returns the value of attribute default_style.
5 6 7 |
# File 'lib/excel_walker/writer/cells.rb', line 5 def default_style @default_style end |
#styles ⇒ Object
Returns the value of attribute styles.
5 6 7 |
# File 'lib/excel_walker/writer/cells.rb', line 5 def styles @styles end |
#width ⇒ Object
Returns the value of attribute width.
5 6 7 |
# File 'lib/excel_walker/writer/cells.rb', line 5 def width @width end |
Instance Method Details
#build ⇒ Object
26 27 28 29 |
# File 'lib/excel_walker/writer/cells.rb', line 26 def build build_data build_styles end |
#set_data_at(range, cell_data) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/excel_walker/writer/cells.rb', line 12 def set_data_at(range, cell_data) range = [range] if range.is_a?(Fixnum) range.each do |i| data[i] = cell_data end end |
#set_style_at(range, cell_style) ⇒ Object
19 20 21 22 23 24 |
# File 'lib/excel_walker/writer/cells.rb', line 19 def set_style_at(range, cell_style) range = [range] if range.is_a?(Fixnum) range.each do |i| styles[i] = cell_style end end |