Class: JSON::Schema::Number
- Inherits:
-
Leaf
- Object
- Leaf
- JSON::Schema::Number
show all
- Defined in:
- lib/json/schema/number.rb
Instance Method Summary
collapse
Methods inherited from Leaf
#default, #description, #enum, #initialize, #required, #required?, #to_json
Instance Method Details
9
10
11
|
# File 'lib/json/schema/number.rb', line 9
def max(i)
tap { @maximum = i }
end
|
5
6
7
|
# File 'lib/json/schema/number.rb', line 5
def min(i)
tap { @minimum = i }
end
|
13
14
15
16
17
18
19
|
# File 'lib/json/schema/number.rb', line 13
def to_h
super.merge!({
type: "number",
minimum: @minimum,
maximum: @maximum
}).compact
end
|