Class: OOXML::Excel::Styles::NumFmt

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code.



81
82
83
# File 'lib/ooxml_excel/styles.rb', line 81

def code
  @code
end

#idObject

Returns the value of attribute id.



81
82
83
# File 'lib/ooxml_excel/styles.rb', line 81

def id
  @id
end

Class Method Details

.load_from_node(num_fmt_node) ⇒ Object



82
83
84
85
86
87
# File 'lib/ooxml_excel/styles.rb', line 82

def self.load_from_node(num_fmt_node)
  new_format = self.new.tap do |number_format|
    number_format.id = num_fmt_node.attributes["numFmtId"].try(:value)
    number_format.code = num_fmt_node.attributes["formatCode"].try(:value)
  end
end