Class: Twitch::StreamMarkersResource
- Defined in:
- lib/twitch/resources/stream_markers.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#create(user_id:, **params) ⇒ Object
Required scope: channel:manage:broadcast.
-
#list(**params) ⇒ Object
Required scope: user:read:broadcast.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Twitch::Resource
Instance Method Details
#create(user_id:, **params) ⇒ Object
Required scope: channel:manage:broadcast
11 12 13 14 15 |
# File 'lib/twitch/resources/stream_markers.rb', line 11 def create(user_id:, **params) response = post_request("streams/markers", body: params.merge(user_id: user_id)) StreamMarker.new(response.body.dig("data")[0]) if response.success? end |
#list(**params) ⇒ Object
Required scope: user:read:broadcast
4 5 6 7 8 |
# File 'lib/twitch/resources/stream_markers.rb', line 4 def list(**params) response = get_request("streams/markers", params: params) Collection.from_response(response, type: StreamMarker) end |