Class: LinkedRails::MediaObject

Inherits:
Resource
  • Object
show all
Defined in:
app/models/linked_rails/media_object.rb

Instance Attribute Summary collapse

Attributes inherited from Resource

#iri

Instance Method Summary collapse

Methods inherited from Resource

#anonymous_iri?

Methods included from Model

#build_child, #singular_resource?

Methods included from LinkedRails::Model::Serialization

#preview_includes, #show_includes

Methods included from LinkedRails::Model::Iri

#anonymous_iri, #anonymous_iri?, #iri, #iri_opts, #reload, #root_relative_iri, #route_fragment

Methods included from LinkedRails::Model::Enhancements

#enhanced_with?

Methods included from LinkedRails::Model::Dirty

#previous_changes_by_predicate, #previously_changed_relations

Methods included from LinkedRails::Model::Collections

#collection_for, #parent_collections

Instance Attribute Details

#content_typeObject

Returns the value of attribute content_type.



5
6
7
# File 'app/models/linked_rails/media_object.rb', line 5

def content_type
  @content_type
end

#descriptionObject

Returns the value of attribute description.



5
6
7
# File 'app/models/linked_rails/media_object.rb', line 5

def description
  @description
end

#filenameObject

Returns the value of attribute filename.



5
6
7
# File 'app/models/linked_rails/media_object.rb', line 5

def filename
  @filename
end

#position_yObject

Returns the value of attribute position_y.



5
6
7
# File 'app/models/linked_rails/media_object.rb', line 5

def position_y
  @position_y
end

#typeObject



27
28
29
# File 'app/models/linked_rails/media_object.rb', line 27

def type
  @type ||= content_type&.split('/')&.first
end

#uploaded_atObject

Returns the value of attribute uploaded_at.



5
6
7
# File 'app/models/linked_rails/media_object.rb', line 5

def uploaded_at
  @uploaded_at
end

Instance Method Details

#rdf_typeObject



16
17
18
19
20
21
22
23
24
25
# File 'app/models/linked_rails/media_object.rb', line 16

def rdf_type
  case type&.to_sym
  when :image
    Vocab.schema.ImageObject
  when :video
    Vocab.schema.VideoObject
  else
    Vocab.schema.MediaObject
  end
end