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
15 16 17 18 |
# File 'lib/axlsx/drawing/num_val.rb', line 15 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.
10 11 12 |
# File 'lib/axlsx/drawing/num_val.rb', line 10 def format_code @format_code end |
Instance Method Details
#to_xml_string(idx, str = "") ⇒ Object
serialize the object
27 28 29 30 31 32 |
# File 'lib/axlsx/drawing/num_val.rb', line 27 def to_xml_string(idx, str = "") Axlsx::validate_unsigned_int(idx) if !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 |