Class: OOXML::Excel::Styles::CellStyleXfs

Inherits:
Object
  • Object
show all
Defined in:
lib/ooxml_excel/styles.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attrs) ⇒ CellStyleXfs

Returns a new instance of CellStyleXfs.



98
99
100
# File 'lib/ooxml_excel/styles.rb', line 98

def initialize(**attrs)
  attrs.each { |property, value| send("#{property}=", value)}
end

Instance Attribute Details

#fill_idObject

Returns the value of attribute fill_id.



97
98
99
# File 'lib/ooxml_excel/styles.rb', line 97

def fill_id
  @fill_id
end

#font_idObject

Returns the value of attribute font_id.



97
98
99
# File 'lib/ooxml_excel/styles.rb', line 97

def font_id
  @font_id
end

#idObject

Returns the value of attribute id.



97
98
99
# File 'lib/ooxml_excel/styles.rb', line 97

def id
  @id
end

#number_formatting_idObject

Returns the value of attribute number_formatting_id.



97
98
99
# File 'lib/ooxml_excel/styles.rb', line 97

def number_formatting_id
  @number_formatting_id
end

Class Method Details

.load_from_node(cell_style_xfs_node) ⇒ Object



101
102
103
104
105
106
107
108
109
110
111
# File 'lib/ooxml_excel/styles.rb', line 101

def self.load_from_node(cell_style_xfs_node)
  attributes = cell_style_xfs_node.attributes


  self.new(
    id: attributes["xfId"].value.to_i,
    number_formatting_id: attributes["numFmtId"].value.to_i,
    fill_id: attributes["fillId"].value.to_i,
    font_id: attributes["fontId"].value.to_i
  )
end