Class: JSON::Schema::ItemsLimitAttribute

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

Direct Known Subclasses

MaxItemsAttribute, MinItemsAttribute

Constant Summary

Constants inherited from Attribute

Attribute::TYPE_CLASS_MAPPINGS

Class Method Summary collapse

Methods inherited from LimitAttribute

error_message, exclusive?, invalid?, limit, limit_name, validate

Methods inherited from Attribute

build_fragment, data_valid_for_type?, type_of_data, validate, validation_error, validation_errors

Class Method Details

.acceptable_typeObject


6
7
8
# File 'lib/json-schema/attributes/limits/items.rb', line 6

def self.acceptable_type
  Array
end

.value(data) ⇒ Object


10
11
12
# File 'lib/json-schema/attributes/limits/items.rb', line 10

def self.value(data)
  data.length
end