Class: WirisPlugin::JSonIntegerFormat

Inherits:
Object
  • Object
show all
Includes:
Wiris
Defined in:
lib/com/wiris/util/json/JSonIntegerFormat.rb

Constant Summary collapse

HEXADECIMAL =
0

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(n, format) ⇒ JSonIntegerFormat

Returns a new instance of JSonIntegerFormat.



9
10
11
12
13
# File 'lib/com/wiris/util/json/JSonIntegerFormat.rb', line 9

def initialize(n, format)
    super()
    self.n = n
    self.format = format
end

Instance Attribute Details

#formatObject

Returns the value of attribute format.



8
9
10
# File 'lib/com/wiris/util/json/JSonIntegerFormat.rb', line 8

def format
  @format
end

#nObject

Returns the value of attribute n.



7
8
9
# File 'lib/com/wiris/util/json/JSonIntegerFormat.rb', line 7

def n
  @n
end

Instance Method Details

#toStringObject



14
15
16
17
18
19
# File 'lib/com/wiris/util/json/JSonIntegerFormat.rb', line 14

def toString()
    if @format == HEXADECIMAL
        return "0x" + StringTools::hex(@n,0).to_s
    end
    return "" + @n.to_s
end