Class: Spreadsheetkit::Font
- Inherits:
-
Object
- Object
- Spreadsheetkit::Font
- Defined in:
- lib/spreadsheetkit/font.rb
Instance Attribute Summary collapse
-
#style ⇒ Object
readonly
Returns the value of attribute style.
Instance Method Summary collapse
-
#initialize(style, inline_style) ⇒ Font
constructor
A new instance of Font.
- #parse(inline_style) ⇒ Object
Constructor Details
#initialize(style, inline_style) ⇒ Font
Returns a new instance of Font.
6 7 8 9 |
# File 'lib/spreadsheetkit/font.rb', line 6 def initialize(style, inline_style) @style = style parse inline_style end |
Instance Attribute Details
#style ⇒ Object (readonly)
Returns the value of attribute style.
4 5 6 |
# File 'lib/spreadsheetkit/font.rb', line 4 def style @style end |
Instance Method Details
#parse(inline_style) ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/spreadsheetkit/font.rb', line 11 def parse(inline_style) inline_style.each do |attr, value| case attr when 'font-size' then font_size(value) when 'font-style' then font_style(value) when 'font-weight' then font_weight(value) when 'text-decoration' then font_style(value) when 'text-shadow' then text_shadow(value) when 'vertical-align' then vertial_align(value) end end end |