Sha256: 12d614a7dff09a33d69d95f98770b6db98ad65b12f20359dd9a3442a62cf7e3e

Contents?: true

Size: 439 Bytes

Versions: 28

Compression:

Stored size: 439 Bytes

Contents

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

    def item
      @item ||= sdk_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

28 entries across 28 versions & 1 rubygems

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