Class: IIIFManifest::V3::AnnotationContent

Inherits:
Object
  • Object
show all
Defined in:
lib/iiif_manifest/v3/annotation_content.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(type:, motivation:, **kwargs) ⇒ AnnotationContent

Returns a new instance of AnnotationContent.



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/iiif_manifest/v3/annotation_content.rb', line 6

def initialize(type:, motivation:, **kwargs)
  # If a user requires a specific ID at the annotation level, this attr overrides
  # the automatic ID creation.
  @annotation_id = kwargs[:annotation_id]
  # Body level ids are only required for annotations delivering content,
  # such as a transcript/caption file or an annotation containing an image.
  @body_id = kwargs[:body_id]
  @type = type
  @motivation = motivation
  @format = kwargs[:format]
  @language = kwargs[:language]
  @label = kwargs[:label]
  @value = kwargs[:value]
  @media_fragment = kwargs[:media_fragment]
end

Instance Attribute Details

#annotation_idObject (readonly)

Returns the value of attribute annotation_id.



4
5
6
# File 'lib/iiif_manifest/v3/annotation_content.rb', line 4

def annotation_id
  @annotation_id
end

#body_idObject (readonly)

Returns the value of attribute body_id.



4
5
6
# File 'lib/iiif_manifest/v3/annotation_content.rb', line 4

def body_id
  @body_id
end

#formatObject (readonly)

Returns the value of attribute format.



4
5
6
# File 'lib/iiif_manifest/v3/annotation_content.rb', line 4

def format
  @format
end

#labelObject (readonly)

Returns the value of attribute label.



4
5
6
# File 'lib/iiif_manifest/v3/annotation_content.rb', line 4

def label
  @label
end

#languageObject (readonly)

Returns the value of attribute language.



4
5
6
# File 'lib/iiif_manifest/v3/annotation_content.rb', line 4

def language
  @language
end

#media_fragmentObject (readonly)

Returns the value of attribute media_fragment.



4
5
6
# File 'lib/iiif_manifest/v3/annotation_content.rb', line 4

def media_fragment
  @media_fragment
end

#motivationObject (readonly)

Returns the value of attribute motivation.



4
5
6
# File 'lib/iiif_manifest/v3/annotation_content.rb', line 4

def motivation
  @motivation
end

#typeObject (readonly)

Returns the value of attribute type.



4
5
6
# File 'lib/iiif_manifest/v3/annotation_content.rb', line 4

def type
  @type
end

#valueObject (readonly)

Returns the value of attribute value.



4
5
6
# File 'lib/iiif_manifest/v3/annotation_content.rb', line 4

def value
  @value
end