Class: JSON::Schema::NumericLimitAttribute

Inherits:
LimitAttribute show all
Defined in:
lib/json-schema/attributes/limit.rb

Direct Known Subclasses

MaximumAttribute, MinimumAttribute

Constant Summary

Constants inherited from Attribute

Attribute::TYPE_CLASS_MAPPINGS

Class Method Summary collapse

Methods inherited from LimitAttribute

exclusive?, invalid?, limit, limit_name, validate, value

Methods inherited from Attribute

build_fragment, data_valid_for_type?, validate, validation_error, validation_errors

Class Method Details

.acceptable_typeObject


137
138
139
# File 'lib/json-schema/attributes/limit.rb', line 137

def self.acceptable_type
  Numeric
end

.error_message(schema) ⇒ Object


141
142
143
144
# File 'lib/json-schema/attributes/limit.rb', line 141

def self.error_message(schema)
  exclusivity = exclusive?(schema) ? 'exclusively' : 'inclusively'
  format("did not have a %s value of %s, %s", limit_name, limit(schema), exclusivity)
end