Class: Bunny::VideoLibrary

Inherits:
Object
  • Object
show all
Defined in:
lib/bunny/models/video_library.rb

Class Method Summary collapse

Methods inherited from Object

#camel_to_snake, #initialize, #to_ostruct

Constructor Details

This class inherits a constructor from Bunny::Object

Class Method Details

.create(name:) ⇒ Object



9
10
11
12
# File 'lib/bunny/models/video_library.rb', line 9

def create(name:)
  response = Client.post_request("videolibrary", body: { name: name })
  VideoLibrary.new(response.body)
end

.delete(id:) ⇒ Object



24
25
26
# File 'lib/bunny/models/video_library.rb', line 24

def delete(id:)
  Client.delete_request("videolibrary/#{id}")
end

.listObject



4
5
6
7
# File 'lib/bunny/models/video_library.rb', line 4

def list
  response = Client.get_request("videolibrary")
  Collection.from_response(response, type: VideoLibrary)
end

.retrieve(id:) ⇒ Object



14
15
16
17
# File 'lib/bunny/models/video_library.rb', line 14

def retrieve(id:)
  response = Client.get_request("videolibrary/#{id}")
  VideoLibrary.new(response.body)
end

.update(id:, **attributes) ⇒ Object



19
20
21
22
# File 'lib/bunny/models/video_library.rb', line 19

def update(id:, **attributes)
  response = Client.post_request("videolibrary/#{id}", body: attributes)
  VideoLibrary.new(response.body)
end