Class: IIIF::V3::Presentation::AnnotationCollection

Inherits:
AbstractResource show all
Defined in:
lib/iiif/v3/presentation/annotation_collection.rb

Constant Summary collapse

TYPE =
'AnnotationCollection'.freeze

Constants inherited from AbstractResource

AbstractResource::CONTENT_RESOURCE_PROPERTIES, AbstractResource::PAGING_PROPERTIES

Constants included from HashBehaviours

HashBehaviours::SIMPLE_SELF_RETURNERS

Instance Method Summary collapse

Methods inherited from AbstractResource

#any_type_keys, from_ordered_hash, #hash_only_keys, #legal_viewing_direction_values, #legal_viewing_hint_values, #numeric_only_keys, parse, #prohibited_keys, #string_only_keys, #to_json, #to_ordered_hash, #uri_only_keys, #validate

Methods included from HashBehaviours

#clear, #merge, #merge!, #reject!, #select, #select!

Constructor Details

#initialize(hsh = {}) ⇒ AnnotationCollection

TODO: paging properties Collection, AnnotationCollection, (formerly layer --> AnnotationPage???) allow; forbidden o.w.

first, last, next, prev id is URI, but may have other info total, startIndex The value must be a non-negative integer.

don't forget to validate



30
31
32
33
# File 'lib/iiif/v3/presentation/annotation_collection.rb', line 30

def initialize(hsh={})
  hsh['type'] = TYPE unless hsh.has_key? 'type'
  super(hsh)
end

Instance Method Details

#array_only_keysObject



16
17
18
# File 'lib/iiif/v3/presentation/annotation_collection.rb', line 16

def array_only_keys
  super + %w{ content }
end

#int_only_keysObject



12
13
14
# File 'lib/iiif/v3/presentation/annotation_collection.rb', line 12

def int_only_keys
  super + %w{ total }
end

#required_keysObject



8
9
10
# File 'lib/iiif/v3/presentation/annotation_collection.rb', line 8

def required_keys
  super + %w{ id }
end