Class: IronCalc::Model
- Inherits:
-
Object
- Object
- IronCalc::Model
- Defined in:
- lib/ironcalc/native_methods.rb,
lib/ironcalc/model.rb
Overview
Instance Method Summary collapse
-
#get_cell_style(sheet, row, column) ⇒ Hash
Returns the cell style as a Hash with string keys (snake_case, matching the engine’s serde field names), e.g.
-
#set_cell_style(sheet, row, column, style) ⇒ void
Sets the cell style from a Hash (snake_case keys) or a JSON string.
Instance Method Details
#get_cell_style(sheet, row, column) ⇒ Hash
Returns the cell style as a Hash with string keys (snake_case, matching the engine’s serde field names), e.g.
{ "num_fmt" => "general", "font" => { "b" => false, ... }, ... }
17 18 19 |
# File 'lib/ironcalc/model.rb', line 17 def get_cell_style(sheet, row, column) JSON.parse(get_cell_style_json(sheet, row, column)) end |
#set_cell_style(sheet, row, column, style) ⇒ void
This method returns an undefined value.
Sets the cell style from a Hash (snake_case keys) or a JSON string.
29 30 31 32 |
# File 'lib/ironcalc/model.rb', line 29 def set_cell_style(sheet, row, column, style) json = style.is_a?(String) ? style : JSON.generate(style) set_cell_style_json(sheet, row, column, json) end |