Sha256: d37a1a0447ae3e41f9db6eaad57ce34f6206808f473fd9856990dbf8afecf231

Contents?: true

Size: 674 Bytes

Versions: 10

Compression:

Stored size: 674 Bytes

Contents

# -*- coding: utf-8 -*-
module Axlsx

  #This class specifies data for a particular data point.
  class StrVal

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

    # creates a new StrVal object
    # @option options [String] v
    def initialize(options={})
      @v = ""
      @idx = 0
      options.each do |o|
        self.send("#{o[0]}=", o[1]) if self.respond_to? "#{o[0]}="
      end
    end
    # @see v
    def v=(v)
      @v = v.to_s
    end

    # serialize the object
    def to_xml_string(idx, str = "")
      Axlsx::validate_unsigned_int(idx)
      str << '<c:pt idx="' << idx.to_s << '"><c:v>' << v.to_s << '</c:v></c:pt>'
    end

  end

end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
axlsx-1.3.1 lib/axlsx/drawing/str_val.rb
axlsx-1.2.3 lib/axlsx/drawing/str_val.rb
axlsx-1.2.2 lib/axlsx/drawing/str_val.rb
axlsx-1.2.1 lib/axlsx/drawing/str_val.rb
axlsx-1.2.0 lib/axlsx/drawing/str_val.rb
axlsx-1.1.8 lib/axlsx/drawing/str_val.rb
axlsx-1.1.7 lib/axlsx/drawing/str_val.rb
axlsx-1.1.6 lib/axlsx/drawing/str_val.rb
axlsx-1.1.5 lib/axlsx/drawing/str_val.rb
axlsx-1.1.4 lib/axlsx/drawing/str_val.rb