Sha256: ab3212429ba643442393f2300756b7608bdad7adbdf220f062e4ec4558f97733

Contents?: true

Size: 757 Bytes

Versions: 12

Compression:

Stored size: 757 Bytes

Contents

module MeducationSDK

  class CollectionTopic < Resource

    self.path = "/collection_topics"

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

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

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

  class CollectionTopicMock < CollectionTopic
    extend Loquor::ResourceMock

    self.attributes = {
      id: 728463,
      title: 'This is a mock collection topic',
      description: 'This is a sample description',
      collection_id: 1,
      section_id: 17,
      resource_ids: [3, 4, 5],
      views_in_last_30_days: 1,
      views_in_last_60_days: 2,
      rating: 123,
      author_ids: [7,12,54]
    }
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
meducation_sdk-1.6.13 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.6.12 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.6.11 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.6.10 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.6.6 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.6.5 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.6.4 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.6.3 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.6.2 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.6.1 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.6.0 lib/meducation_sdk/resources/collection_topic.rb
meducation_sdk-1.5.7 lib/meducation_sdk/resources/collection_topic.rb