Class: OpenXml::Xlsx::Elements::PatternFill
- Inherits:
-
Struct
- Object
- Struct
- OpenXml::Xlsx::Elements::PatternFill
- Defined in:
- lib/openxml/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
4 5 6 |
# File 'lib/openxml/xlsx/elements/pattern_fill.rb', line 4 def background_color @background_color end |
#foreground_color ⇒ Object
Returns the value of attribute foreground_color
4 5 6 |
# File 'lib/openxml/xlsx/elements/pattern_fill.rb', line 4 def foreground_color @foreground_color end |
#type ⇒ Object
Returns the value of attribute type
4 5 6 |
# File 'lib/openxml/xlsx/elements/pattern_fill.rb', line 4 def type @type end |
Instance Method Details
#to_xml(xml) ⇒ Object
6 7 8 9 10 11 12 13 14 15 |
# File 'lib/openxml/xlsx/elements/pattern_fill.rb', line 6 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 |