Class: Jsapi::JSON::Integer

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

Overview

Represents a JSON integer.

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) ⇒ Integer

Returns a new instance of Integer.



9
10
11
12
# File 'lib/jsapi/json/integer.rb', line 9

def initialize(value, schema)
  super(schema)
  @value = schema.convert(value.to_i)
end

Instance Attribute Details

#valueObject (readonly)

Returns the value of attribute value.



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

def value
  @value
end