Class: Twitch::VideosResource
- Defined in:
- lib/twitch/resources/videos.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#delete(video_id:) ⇒ Object
Required scope: channel:manage:videos.
- #list(**params) ⇒ Object
- #retrieve(id:) ⇒ Object
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Twitch::Resource
Instance Method Details
#delete(video_id:) ⇒ Object
Required scope: channel:manage:videos
18 19 20 |
# File 'lib/twitch/resources/videos.rb', line 18 def delete(video_id:) delete_request("videos?id=#{video_id}") end |
#list(**params) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/twitch/resources/videos.rb', line 3 def list(**params) raise "user_id or game_id is required" unless !params[:user_id].nil? || !params[:game_id].nil? response = get_request("videos", params: params) Collection.from_response(response, type: Video) end |
#retrieve(id:) ⇒ Object
10 11 12 13 14 15 |
# File 'lib/twitch/resources/videos.rb', line 10 def retrieve(id:) response = get_request("videos", params: { id: id }) if response.body Video.new response.body["data"].first end end |