Class: Axlsx::StrVal
- Inherits:
-
Object
- Object
- Axlsx::StrVal
- Includes:
- OptionsParser
- Defined in:
- lib/axlsx/drawing/str_val.rb
Overview
This class specifies data for a particular data point.
Direct Known Subclasses
Instance Attribute Summary collapse
-
#v ⇒ String
a string value.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ StrVal
constructor
creates a new StrVal object.
-
#to_xml_string(idx, str = "") ⇒ Object
serialize the object.
Methods included from OptionsParser
Constructor Details
#initialize(options = {}) ⇒ StrVal
creates a new StrVal object
8 9 10 11 12 |
# File 'lib/axlsx/drawing/str_val.rb', line 8 def initialize( = {}) @v = "" @idx = 0 end |
Instance Attribute Details
#v ⇒ String
a string value.
16 17 18 |
# File 'lib/axlsx/drawing/str_val.rb', line 16 def v @v end |
Instance Method Details
#to_xml_string(idx, str = "") ⇒ Object
serialize the object
24 25 26 27 28 29 |
# File 'lib/axlsx/drawing/str_val.rb', line 24 def to_xml_string(idx, str = "") Axlsx::validate_unsigned_int(idx) if !v.to_s.empty? str << ('<c:pt idx="' << idx.to_s << '"><c:v>' << ::CGI.escapeHTML(v.to_s) << '</c:v></c:pt>') end end |