Class: CaxlsxBuilder::Cell
- Inherits:
-
Object
- Object
- CaxlsxBuilder::Cell
- Defined in:
- lib/caxlsx_builder/cell.rb
Instance Method Summary collapse
- #as_style(item, rescue_errors: false) ⇒ Object
-
#initialize(style: :default, type: :string) ⇒ Cell
constructor
A new instance of Cell.
Constructor Details
#initialize(style: :default, type: :string) ⇒ Cell
Returns a new instance of Cell.
5 6 7 8 |
# File 'lib/caxlsx_builder/cell.rb', line 5 def initialize(style: :default, type: :string) @style = style @type = type end |
Instance Method Details
#as_style(item, rescue_errors: false) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/caxlsx_builder/cell.rb', line 10 def as_style(item, rescue_errors: false) style = @style.respond_to?(:call) ? call_style_proc(item, rescue_errors:) : @style type = @type.respond_to?(:call) ? call_type_proc(item, rescue_errors:) : @type { style:, type: } end |