Sha256: ffaae54909c7aea5cbc9b3e732b1e2751ff6b29dcde52d56e06cf3bf4202542e

Contents?: true

Size: 402 Bytes

Versions: 9

Compression:

Stored size: 402 Bytes

Contents

module MeducationSDK
  class Vote < Resource
    self.path = "/votes"

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

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

  class VoteMock < Vote
    extend Loquor::ResourceMock

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

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
meducation_sdk-1.5.7 lib/meducation_sdk/resources/vote.rb
meducation_sdk-1.5.6 lib/meducation_sdk/resources/vote.rb
meducation_sdk-1.5.5 lib/meducation_sdk/resources/vote.rb
meducation_sdk-1.5.4 lib/meducation_sdk/resources/vote.rb
meducation_sdk-1.5.3 lib/meducation_sdk/resources/vote.rb
meducation_sdk-1.5.2 lib/meducation_sdk/resources/vote.rb
meducation_sdk-1.5.1 lib/meducation_sdk/resources/vote.rb
meducation_sdk-1.5.0 lib/meducation_sdk/resources/vote.rb
meducation_sdk-1.4.4 lib/meducation_sdk/resources/vote.rb