Sha256: 417379a256f8b3b5928460744edbfab7cd96b14aa26b8755d8a312ecfa0ca4da

Contents?: true

Size: 460 Bytes

Versions: 28

Compression:

Stored size: 460 Bytes

Contents

module MeducationSDK
  class Comment < Resource
    self.path = "/comments"
    self.spi_type = "Item::Comment"

    def item
      @item ||= sdk_class_for(item_type).find(item_id)
    end

    def user
      @user ||= User.find(user_id)
    end
  end

  class CommentMock < Comment
    extend Loquor::ResourceMock

    self.attributes = {
      id: 1,
      user_id: 8,
      item_id: 5, item_type: "MediaFile",
      parsed_content: "Foobar"
    }
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
meducation_sdk-1.6.10 lib/meducation_sdk/resources/comment.rb
meducation_sdk-1.6.6 lib/meducation_sdk/resources/comment.rb
meducation_sdk-1.6.5 lib/meducation_sdk/resources/comment.rb
meducation_sdk-1.6.4 lib/meducation_sdk/resources/comment.rb
meducation_sdk-1.6.3 lib/meducation_sdk/resources/comment.rb
meducation_sdk-1.6.2 lib/meducation_sdk/resources/comment.rb
meducation_sdk-1.6.1 lib/meducation_sdk/resources/comment.rb
meducation_sdk-1.6.0 lib/meducation_sdk/resources/comment.rb