Class: IIIF::Presentation::Manifest

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

Constant Summary collapse

TYPE =
'sc:Manifest'

Constants included from HashBehaviours

HashBehaviours::SIMPLE_SELF_RETURNERS

Instance Method Summary collapse

Methods inherited from AbstractResource

#abstract_resource_only_keys, #any_type_keys, #hash_only_keys, #int_only_keys, #legal_viewing_direction_values, #to_ordered_hash

Methods inherited from Service

#abstract_resource_only_keys, #any_type_keys, from_ordered_hash, #hash_only_keys, #int_only_keys, parse, #to_json, #to_ordered_hash

Methods included from HashBehaviours

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

Constructor Details

#initialize(hsh = {}) ⇒ Manifest

Returns a new instance of Manifest.



25
26
27
28
# File 'lib/iiif/presentation/manifest.rb', line 25

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

Instance Method Details

#array_only_keysObject



17
18
19
# File 'lib/iiif/presentation/manifest.rb', line 17

def array_only_keys
  super + %w{ sequences structures }
end


21
22
23
# File 'lib/iiif/presentation/manifest.rb', line 21

def legal_viewing_hint_values
  %w{ individuals paged continuous }
end

#required_keysObject



9
10
11
# File 'lib/iiif/presentation/manifest.rb', line 9

def required_keys
  super + %w{ @id label }
end

#string_only_keysObject



13
14
15
# File 'lib/iiif/presentation/manifest.rb', line 13

def string_only_keys
  super + %w{ viewing_direction }
end

#validateObject



30
31
32
33
34
# File 'lib/iiif/presentation/manifest.rb', line 30

def validate
  # TODO: check types of sequences and structure members

  super
end