Class: Twitch::RaidsResource
- Defined in:
- lib/twitch/resources/raids.rb
Instance Attribute Summary
Attributes inherited from Resource
Instance Method Summary collapse
-
#create(from_broadcaster_id:, to_broadcaster_id:) ⇒ Object
from_broadcaster_id must match the user in the OAuth token.
-
#delete(broadcaster_id:) ⇒ Object
broadcaster_id must match the user in the OAuth token.
Methods inherited from Resource
Constructor Details
This class inherits a constructor from Twitch::Resource
Instance Method Details
#create(from_broadcaster_id:, to_broadcaster_id:) ⇒ Object
from_broadcaster_id must match the user in the OAuth token
4 5 6 7 8 9 10 |
# File 'lib/twitch/resources/raids.rb', line 4 def create(from_broadcaster_id:, to_broadcaster_id:) attrs = { from_broadcaster_id: from_broadcaster_id, to_broadcaster_id: to_broadcaster_id } response = post_request("raids", body: attrs) Raid.new(response.body.dig("data")[0]) if response.success? end |
#delete(broadcaster_id:) ⇒ Object
broadcaster_id must match the user in the OAuth token
13 14 15 |
# File 'lib/twitch/resources/raids.rb', line 13 def delete(broadcaster_id:) delete_request("raids?broadcaster_id=#{broadcaster_id}") end |