Class: Zype::VideoEntitlements

Inherits:
Base::Consumers show all
Defined in:
lib/zype/models/video_entitlements.rb

Overview

Since:

  • 0.15.0

Constant Summary

Constants inherited from BaseModel

BaseModel::ACCEPTED_KEYS

Instance Attribute Summary

Attributes inherited from BaseModel

#client

Instance Method Summary collapse

Methods inherited from Base::Consumers

#all, #create, #delete, #find, #update

Methods inherited from BaseModel

#all, #auth=, #create, #delete, #find, #initialize, #update

Constructor Details

This class inherits a constructor from Zype::BaseModel

Instance Method Details

#entitled(video_id:, access_token:) ⇒ Object

Checks if the consumer is entitled to watch the video

Parameters:

  • video_id (String)

    ID of the video

  • access_token (String)

    Access token used to identify the consumer

Returns:

  • Hash

Since:

  • 0.15.0



11
12
13
# File 'lib/zype/models/video_entitlements.rb', line 11

def entitled(video_id:, access_token:)
  client.execute(method: :get, path: "/videos/#{video_id}/entitled", params: { access_token: access_token })
end

#pathObject

Since:

  • 0.15.0



15
16
17
# File 'lib/zype/models/video_entitlements.rb', line 15

def path
  @path = 'videos'
end