Sha256: 58f631d63acfb9f489b8c2b02ad2559e549695041cbd1fa931bfe19c7c7f8904

Contents?: true

Size: 466 Bytes

Versions: 3

Compression:

Stored size: 466 Bytes

Contents

module MeducationSDK
  class ItemComment < Loquor::Resource
    self.path = "/item_comments"

    def item
      @item ||= "MeducationSDK::#{item_type}".constantize.find(item_id)
    end

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

  class ItemCommentMock < ItemComment
    extend Loquor::ResourceMock

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
meducation_sdk-0.5.0 lib/meducation_sdk/resources/item_comment.rb
meducation_sdk-0.4.1 lib/meducation_sdk/resources/item_comment.rb
meducation_sdk-0.4.0 lib/meducation_sdk/resources/item_comment.rb