Class: OOXL::CellStyleReference

Inherits:
Object
  • Object
show all
Defined in:
lib/ooxl/xl_objects/cell_style_reference.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(**attrs) ⇒ CellStyleReference

Returns a new instance of CellStyleReference.



10
11
12
# File 'lib/ooxl/xl_objects/cell_style_reference.rb', line 10

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

Instance Attribute Details

#fill_idObject

Returns the value of attribute fill_id.



9
10
11
# File 'lib/ooxl/xl_objects/cell_style_reference.rb', line 9

def fill_id
  @fill_id
end

#font_idObject

Returns the value of attribute font_id.



9
10
11
# File 'lib/ooxl/xl_objects/cell_style_reference.rb', line 9

def font_id
  @font_id
end

#idObject

Returns the value of attribute id.



9
10
11
# File 'lib/ooxl/xl_objects/cell_style_reference.rb', line 9

def id
  @id
end

#number_formatting_idObject

Returns the value of attribute number_formatting_id.



9
10
11
# File 'lib/ooxl/xl_objects/cell_style_reference.rb', line 9

def number_formatting_id
  @number_formatting_id
end

Class Method Details

.load_from_node(cell_style_xfs_node) ⇒ Object



13
14
15
16
17
18
19
20
21
# File 'lib/ooxl/xl_objects/cell_style_reference.rb', line 13

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