Class: Jsapi::JSON::Number

Inherits:
Value
  • Object
show all
Defined in:
lib/jsapi/json/number.rb

Overview

Represents a JSON number.

Instance Attribute Summary collapse

Attributes inherited from Value

#schema

Instance Method Summary collapse

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

#valueObject (readonly)

Returns the value of attribute value.



7
8
9
# File 'lib/jsapi/json/number.rb', line 7

def value
  @value
end