class MeducationSDK::MediaFile
Public Instance Methods
comments()
click to toggle source
# File lib/meducation_sdk/resources/media_file.rb, line 9 def comments @comments ||= Comment.where(item_id: id, item_type: 'MediaFile') end
indexable_content()
click to toggle source
# 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()
click to toggle source
# 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()
click to toggle source
# File lib/meducation_sdk/resources/media_file.rb, line 5 def user @user ||= User.find(user_id) end