Sha256: 9ed76e610704b36cdba84476037caa02281fea901d8af82d28c665060732cd3d

Contents?: true

Size: 449 Bytes

Versions: 5

Compression:

Stored size: 449 Bytes

Contents

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

    def item
      @item ||= "MeducationSDK::#{item_type}".constantize.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

5 entries across 5 versions & 1 rubygems

Version Path
meducation_sdk-0.9.0 lib/meducation_sdk/resources/comment.rb
meducation_sdk-0.8.0 lib/meducation_sdk/resources/comment.rb
meducation_sdk-0.7.0 lib/meducation_sdk/resources/comment.rb
meducation_sdk-0.6.1 lib/meducation_sdk/resources/comment.rb
meducation_sdk-0.6.0 lib/meducation_sdk/resources/comment.rb