Class: MeducationSDK::MediaFile
- Inherits:
-
Resource
- Object
- Loquor::Resource
- Resource
- MeducationSDK::MediaFile
show all
- Defined in:
- lib/meducation_sdk/resources/media_file.rb
Defined Under Namespace
Modules: State
Constant Summary
Constants included
from Helpers
Helpers::SDK_TO_SPI_MAPPINGS
Instance Method Summary
collapse
Methods inherited from Resource
#created_at, spi_type=, #updated_at
Methods included from Helpers
#sdk_class_for, #sdk_type_for, #spi_type_for
Instance Method Details
9
10
11
|
# File 'lib/meducation_sdk/resources/media_file.rb', line 9
def
@comments ||= Comment.where(item_id: id, item_type: 'MediaFile')
end
|
#indexable_content ⇒ Object
13
14
15
16
17
18
|
# File 'lib/meducation_sdk/resources/media_file.rb', line 13
def indexable_content
@indexable_content ||= begin
object = IndexableContent.where(item_id: id, item_type: 'MediaFile').first
object ? object.content : ''
end
end
|
#item_mesh_headings ⇒ Object
20
21
22
23
24
25
26
|
# File 'lib/meducation_sdk/resources/media_file.rb', line 20
def item_mesh_headings
@item_mesh_headings ||= begin
@data['item_mesh_headings'].map do |imh|
ItemMeshHeading.new(item_id: imh['item_id'], item_type: imh['item_type'], mesh_root: imh['mesh_root'], mesh_heading: imh['mesh_heading'], relevance: imh['relevance'])
end
end
end
|
#user ⇒ Object
5
6
7
|
# File 'lib/meducation_sdk/resources/media_file.rb', line 5
def user
@user ||= User.find(user_id)
end
|