Class: Broadcast::Resources::Segments

Inherits:
Base
  • Object
show all
Defined in:
lib/broadcast/resources/segments.rb

Instance Method Summary collapse

Methods inherited from Base

#initialize

Constructor Details

This class inherits a constructor from Broadcast::Resources::Base

Instance Method Details

#create(**attrs) ⇒ Object



15
16
17
# File 'lib/broadcast/resources/segments.rb', line 15

def create(**attrs)
  post('/api/v1/segments', { segment: attrs })
end

#delete(id) ⇒ Object



23
24
25
# File 'lib/broadcast/resources/segments.rb', line 23

def delete(id)
  @client.request(:delete, "/api/v1/segments/#{id}")
end

#get_segment(id, page: nil) ⇒ Object



10
11
12
13
# File 'lib/broadcast/resources/segments.rb', line 10

def get_segment(id, page: nil)
  params = page ? { page: page } : {}
  get("/api/v1/segments/#{id}.json", params)
end

#list(**params) ⇒ Object



6
7
8
# File 'lib/broadcast/resources/segments.rb', line 6

def list(**params)
  get('/api/v1/segments.json', params)
end

#update(id, **attrs) ⇒ Object



19
20
21
# File 'lib/broadcast/resources/segments.rb', line 19

def update(id, **attrs)
  patch("/api/v1/segments/#{id}", { segment: attrs })
end