Class: OpenVidu::Session
- Inherits:
-
Base
- Object
- Base
- OpenVidu::Session
show all
- Defined in:
- lib/open_vidu/session.rb
Overview
Constant Summary
collapse
- ASSIGNABLE_PARAMS =
%w[
mediaMode recordingMode customSessionId defaultOutputMode
defaultRecordingLayout defaultCustomLayout
].freeze
- GENERATED_PARAMS =
%w[sessionId createdAt connections recording].freeze
- ALL_PARAMS =
(ASSIGNABLE_PARAMS + GENERATED_PARAMS).freeze
Instance Attribute Summary
Attributes inherited from Base
#server
Instance Method Summary
collapse
Methods inherited from Base
content_key, #create_params, #initialize
Constructor Details
This class inherits a constructor from OpenVidu::Base
Instance Method Details
#all ⇒ Object
11
12
13
14
15
|
# File 'lib/open_vidu/session.rb', line 11
def all
OpenVidu::Command.new(
:session, :get, 'api/sessions', { options: { server: server } }
).execute
end
|
#create ⇒ Object
35
36
37
38
39
|
# File 'lib/open_vidu/session.rb', line 35
def create
OpenVidu::Command.new(
:session, :post, 'api/sessions', create_params, { options: { server: server } }
).execute
end
|
#delete ⇒ Object
41
42
43
44
45
|
# File 'lib/open_vidu/session.rb', line 41
def delete
OpenVidu::Command.new(
:session, :delete, "api/sessions/#{customSessionId}", { options: { server: server } }
).execute
end
|
#exists?(id) ⇒ Boolean
23
24
25
26
27
28
29
30
31
32
33
|
# File 'lib/open_vidu/session.rb', line 23
def exists?(id)
begin
OpenVidu::Command.new(
:session, :get, "api/sessions/#{id}", { options: { server: server } }
).execute
true
rescue OpenVidu::ResponseError => e
raise e unless e.response.code == 404
false
end
end
|
#find(id) ⇒ Object
17
18
19
20
21
|
# File 'lib/open_vidu/session.rb', line 17
def find(id)
OpenVidu::Command.new(
:session, :get, "api/sessions/#{id}", { options: { server: server } }
).execute
end
|