Class: Jsapi::JSON::Number
Overview
Represents a JSON number.
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Attributes inherited from Value
Instance Method Summary collapse
-
#initialize(value, schema) ⇒ Number
constructor
A new instance of Number.
Methods inherited from Value
#empty?, #inspect, #null?, #validate
Constructor Details
#initialize(value, schema) ⇒ Number
Returns a new instance of Number.
9 10 11 12 |
# File 'lib/jsapi/json/number.rb', line 9 def initialize(value, schema) super(schema) @value = schema.convert(value.to_f) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
7 8 9 |
# File 'lib/jsapi/json/number.rb', line 7 def value @value end |