Sha256: b65b71938efd48f872efe4b3f9cb01588493d358ec8e1a4bba7232ebf8c91283

Contents?: true

Size: 883 Bytes

Versions: 18

Compression:

Stored size: 883 Bytes

Contents

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

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

    # A string representing the format code to apply.
    # For more information see see the SpreadsheetML numFmt element's (ยง18.8.30) formatCode attribute.
    # @return [String]
    attr_reader :format_code

    # creates a new NumVal object
    # @option options [String] formatCode
    # @option options [Integer] v
    def initialize(options={})
      @format_code = "General"
      super(options)
    end

    # @see format_code
    def format_code=(v)
      Axlsx::validate_string(v)
      @format_code = v
    end

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

Version data entries

18 entries across 18 versions & 2 rubygems

Version Path
caxlsx-2.0.2 lib/axlsx/drawing/num_val.rb
axlsx-2.0.1 lib/axlsx/drawing/num_val.rb
axlsx-2.0.0 lib/axlsx/drawing/num_val.rb
axlsx-1.3.6 lib/axlsx/drawing/num_val.rb
axlsx-1.3.5 lib/axlsx/drawing/num_val.rb
axlsx-1.3.4 lib/axlsx/drawing/num_val.rb
axlsx-1.3.3 lib/axlsx/drawing/num_val.rb
axlsx-1.3.2 lib/axlsx/drawing/num_val.rb
axlsx-1.3.1 lib/axlsx/drawing/num_val.rb
axlsx-1.2.3 lib/axlsx/drawing/num_val.rb
axlsx-1.2.2 lib/axlsx/drawing/num_val.rb
axlsx-1.2.1 lib/axlsx/drawing/num_val.rb
axlsx-1.2.0 lib/axlsx/drawing/num_val.rb
axlsx-1.1.8 lib/axlsx/drawing/num_val.rb
axlsx-1.1.7 lib/axlsx/drawing/num_val.rb
axlsx-1.1.6 lib/axlsx/drawing/num_val.rb
axlsx-1.1.5 lib/axlsx/drawing/num_val.rb
axlsx-1.1.4 lib/axlsx/drawing/num_val.rb