class IIIF::Presentation::Canvas

Constants

TYPE

TODO (?) a simple ‘Image Canvas’ constructor.

Public Class Methods

new(hsh={}) click to toggle source
# File lib/iiif/presentation/canvas.rb, line 32
def initialize(hsh={})
  hsh['@type'] = TYPE unless hsh.has_key? '@type'
  super(hsh)
end

Public Instance Methods

any_type_keys() click to toggle source
# File lib/iiif/presentation/canvas.rb, line 15
def any_type_keys
  super + %w{  }
end
array_only_keys() click to toggle source
# File lib/iiif/presentation/canvas.rb, line 19
def array_only_keys
  super + %w{ images other_content }
end
int_only_keys() click to toggle source

TODO: test and validate

# File lib/iiif/presentation/canvas.rb, line 24
def int_only_keys
  super + %w{ width height }
end
required_keys() click to toggle source
# File lib/iiif/presentation/canvas.rb, line 11
def required_keys
  super + %w{ @id width height label }
end
validate() click to toggle source
Calls superclass method
# 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