Sha256: 1d9795c78580b0adf51e5720b14ce81b227fd117337ec922bafbfa4d96b6c2c7

Contents?: true

Size: 665 Bytes

Versions: 2

Compression:

Stored size: 665 Bytes

Contents

module Axlsx
  # This class specifies data for a particular data point.
  class StrVal
    include Axlsx::OptionsParser

    # creates a new StrVal object
    # @option options [String] v
    def initialize(options = {})
      @v = ""
      @idx = 0
      parse_options options
    end

    # a string value.
    # @return [String]
    attr_reader :v

    # @see v
    def v=(v)
      @v = v.to_s
    end

    # serialize the object
    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
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
caxlsx-3.4.1 lib/axlsx/drawing/str_val.rb
caxlsx-3.4.0 lib/axlsx/drawing/str_val.rb