Class: Axlsx::NumVal
Overview
This class specifies data for a particular data point.
Instance Attribute Summary collapse
-
#format_code ⇒ String
A string representing the format code to apply.
Attributes inherited from StrVal
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ NumVal
constructor
creates a new NumVal object.
-
#to_xml_string(idx, str = +'')) ⇒ Object
serialize the object.
Methods included from OptionsParser
Constructor Details
#initialize(options = {}) ⇒ NumVal
creates a new NumVal object
14 15 16 17 |
# File 'lib/axlsx/drawing/num_val.rb', line 14 def initialize( = {}) @format_code = "General" super() end |
Instance Attribute Details
#format_code ⇒ String
A string representing the format code to apply. For more information see see the SpreadsheetML numFmt element's (ยง18.8.30) formatCode attribute.
9 10 11 |
# File 'lib/axlsx/drawing/num_val.rb', line 9 def format_code @format_code end |
Instance Method Details
#to_xml_string(idx, str = +'')) ⇒ Object
serialize the object
26 27 28 29 30 31 |
# File 'lib/axlsx/drawing/num_val.rb', line 26 def to_xml_string(idx, str = +'') Axlsx.validate_unsigned_int(idx) unless v.to_s.empty? str << '<c:pt idx="' << idx.to_s << '" formatCode="' << format_code << '"><c:v>' << v.to_s << '</c:v></c:pt>' end end |