Class: IIIF::Presentation::Canvas
- Inherits:
-
AbstractResource
- Object
- Service
- AbstractResource
- IIIF::Presentation::Canvas
- Defined in:
- lib/iiif/presentation/canvas.rb
Constant Summary collapse
- TYPE =
TODO (?) a simple ‘Image Canvas’ constructor.
'sc:Canvas'
Constants included from HashBehaviours
HashBehaviours::SIMPLE_SELF_RETURNERS
Instance Method Summary collapse
- #any_type_keys ⇒ Object
- #array_only_keys ⇒ Object
-
#initialize(hsh = {}) ⇒ Canvas
constructor
A new instance of Canvas.
-
#int_only_keys ⇒ Object
TODO: test and validate.
- #legal_viewing_hint_values ⇒ Object
- #required_keys ⇒ Object
- #validate ⇒ Object
Methods inherited from AbstractResource
#abstract_resource_only_keys, #hash_only_keys, #legal_viewing_direction_values, #string_only_keys, #to_ordered_hash
Methods inherited from Service
#abstract_resource_only_keys, from_ordered_hash, #hash_only_keys, parse, #string_only_keys, #to_json, #to_ordered_hash
Methods included from HashBehaviours
#clear, #merge, #merge!, #reject!, #select, #select!
Constructor Details
Instance Method Details
#any_type_keys ⇒ Object
15 16 17 |
# File 'lib/iiif/presentation/canvas.rb', line 15 def any_type_keys super + %w{ } end |
#array_only_keys ⇒ Object
19 20 21 |
# File 'lib/iiif/presentation/canvas.rb', line 19 def array_only_keys super + %w{ images other_content } end |
#int_only_keys ⇒ Object
TODO: test and validate
24 25 26 |
# File 'lib/iiif/presentation/canvas.rb', line 24 def int_only_keys super + %w{ width height } end |
#legal_viewing_hint_values ⇒ Object
28 29 30 |
# File 'lib/iiif/presentation/canvas.rb', line 28 def legal_viewing_hint_values super + %w{ non-paged } end |
#required_keys ⇒ Object
11 12 13 |
# File 'lib/iiif/presentation/canvas.rb', line 11 def required_keys super + %w{ @id width height label } end |
#validate ⇒ Object
37 38 39 40 41 |
# File 'lib/iiif/presentation/canvas.rb', line 37 def validate # all members of images must be an annotation # all members of otherContent must be an annotation list super end |