Class: Xlsx::Elements::PatternFill
- Inherits:
-
Struct
- Object
- Struct
- Xlsx::Elements::PatternFill
- Defined in:
- lib/xlsx/elements/pattern_fill.rb
Instance Attribute Summary collapse
-
#background_color ⇒ Object
Returns the value of attribute background_color.
-
#foreground_color ⇒ Object
Returns the value of attribute foreground_color.
-
#type ⇒ Object
Returns the value of attribute type.
Instance Method Summary collapse
Instance Attribute Details
#background_color ⇒ Object
Returns the value of attribute background_color
3 4 5 |
# File 'lib/xlsx/elements/pattern_fill.rb', line 3 def background_color @background_color end |
#foreground_color ⇒ Object
Returns the value of attribute foreground_color
3 4 5 |
# File 'lib/xlsx/elements/pattern_fill.rb', line 3 def foreground_color @foreground_color end |
#type ⇒ Object
Returns the value of attribute type
3 4 5 |
# File 'lib/xlsx/elements/pattern_fill.rb', line 3 def type @type end |
Instance Method Details
#to_xml(xml) ⇒ Object
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/xlsx/elements/pattern_fill.rb', line 5 def to_xml(xml) xml.fill do xml.patternFill(patternType: type) do if type.to_s == "solid" foreground_color.to_xml("fgColor", xml) background_color.to_xml("bgColor", xml) end end end end |