Class: JSON::Schema::MinPropertiesAttribute

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

Direct Known Subclasses

MaxPropertiesAttribute

Constant Summary

Constants inherited from Attribute

Attribute::TYPE_CLASS_MAPPINGS

Class Method Summary collapse

Methods inherited from LimitAttribute

exclusive?, invalid?, limit, validate

Methods inherited from Attribute

build_fragment, data_valid_for_type?, validate, validation_error, validation_errors

Class Method Details

.acceptable_typeObject



109
110
111
# File 'lib/json-schema/attributes/limit.rb', line 109

def self.acceptable_type
  Hash
end

.error_message(schema) ⇒ Object



121
122
123
# File 'lib/json-schema/attributes/limit.rb', line 121

def self.error_message(schema)
  "did not contain a minimum number of properties #{limit(schema)}"
end

.limit_nameObject



117
118
119
# File 'lib/json-schema/attributes/limit.rb', line 117

def self.limit_name
  'minProperties'
end

.value(data) ⇒ Object



113
114
115
# File 'lib/json-schema/attributes/limit.rb', line 113

def self.value(data)
  data.size
end