Class: MeducationSDK::CollectionTopic
- Inherits:
-
Resource
- Object
- Loquor::Resource
- Resource
- MeducationSDK::CollectionTopic
show all
- Defined in:
- lib/meducation_sdk/resources/collection_topic.rb
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
#authors ⇒ Object
11
12
13
|
# File 'lib/meducation_sdk/resources/collection_topic.rb', line 11
def authors
@authors ||= Author.where(id: author_ids)
end
|
#collection ⇒ Object
7
8
9
|
# File 'lib/meducation_sdk/resources/collection_topic.rb', line 7
def collection
@collection ||= Collection.find(collection_id)
end
|
19
20
21
|
# File 'lib/meducation_sdk/resources/collection_topic.rb', line 19
def
@comments ||= Comment.where(id: )
end
|
#item_mesh_headings ⇒ Object
23
24
25
26
27
28
29
|
# File 'lib/meducation_sdk/resources/collection_topic.rb', line 23
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
|
#users ⇒ Object
15
16
17
|
# File 'lib/meducation_sdk/resources/collection_topic.rb', line 15
def users
@users ||= User.where(id: authors.map(&:user_id))
end
|