Class: MeducationSDK::CollectionTopic

Inherits:
Resource
  • Object
show all
Defined in:
lib/meducation_sdk/resources/collection_topic.rb

Direct Known Subclasses

CollectionTopicMock

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

#authorsObject



11
12
13
# File 'lib/meducation_sdk/resources/collection_topic.rb', line 11

def authors
  @authors ||= Author.where(id: author_ids)
end

#collectionObject



7
8
9
# File 'lib/meducation_sdk/resources/collection_topic.rb', line 7

def collection 
  @collection ||= Collection.find(collection_id)
end

#commentsObject



19
20
21
# File 'lib/meducation_sdk/resources/collection_topic.rb', line 19

def comments
  @comments ||= Comment.where(id: comment_ids)
end

#usersObject



15
16
17
# File 'lib/meducation_sdk/resources/collection_topic.rb', line 15

def users
  @users ||= User.where(id: authors.map(&:user_id))
end