Class: Habaki::Number
Overview
<number> or <integer> value type
Instance Attribute Summary
Attributes inherited from Value
Instance Method Summary collapse
Methods inherited from Value
#==, #eql?, #hash, #initialize, #read_from_katana
Methods inherited from Node
Methods included from NodeReader
Constructor Details
This class inherits a constructor from Habaki::Value
Instance Method Details
#string(format = Formatter::Base.new) ⇒ String
246 247 248 |
# File 'lib/habaki/value.rb', line 246 def string(format = Formatter::Base.new) "#{data_i_or_f}" end |
#to_f ⇒ Float
235 236 237 |
# File 'lib/habaki/value.rb', line 235 def to_f @data end |
#to_i ⇒ Integer
240 241 242 |
# File 'lib/habaki/value.rb', line 240 def to_i @data.to_i end |