Class: OpenVidu::Command
- Inherits:
-
Object
- Object
- OpenVidu::Command
- Defined in:
- lib/open_vidu/command.rb
Overview
Command
Instance Attribute Summary collapse
-
#endpoint ⇒ Object
readonly
Returns the value of attribute endpoint.
-
#method ⇒ Object
readonly
Returns the value of attribute method.
-
#object ⇒ Object
readonly
Returns the value of attribute object.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#requestor ⇒ Object
readonly
Returns the value of attribute requestor.
-
#responder ⇒ Object
readonly
Returns the value of attribute responder.
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(object, method, endpoint, params = {}, options: {}) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(object, method, endpoint, params = {}, options: {}) ⇒ Command
Returns a new instance of Command.
10 11 12 13 14 15 16 17 18 19 |
# File 'lib/open_vidu/command.rb', line 10 def initialize(object, method, endpoint, params = {}, options: {}) @object = object @method = method @endpoint = endpoint @params = params @server = .fetch(:server) @requestor = [:requestor] || OpenVidu::Requestor.new(server, method, endpoint, params) @responder = [:responder] || OpenVidu::Responder.new end |
Instance Attribute Details
#endpoint ⇒ Object (readonly)
Returns the value of attribute endpoint.
8 9 10 |
# File 'lib/open_vidu/command.rb', line 8 def endpoint @endpoint end |
#method ⇒ Object (readonly)
Returns the value of attribute method.
8 9 10 |
# File 'lib/open_vidu/command.rb', line 8 def method @method end |
#object ⇒ Object (readonly)
Returns the value of attribute object.
8 9 10 |
# File 'lib/open_vidu/command.rb', line 8 def object @object end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
8 9 10 |
# File 'lib/open_vidu/command.rb', line 8 def params @params end |
#requestor ⇒ Object (readonly)
Returns the value of attribute requestor.
8 9 10 |
# File 'lib/open_vidu/command.rb', line 8 def requestor @requestor end |
#responder ⇒ Object (readonly)
Returns the value of attribute responder.
8 9 10 |
# File 'lib/open_vidu/command.rb', line 8 def responder @responder end |
#server ⇒ Object (readonly)
Returns the value of attribute server.
8 9 10 |
# File 'lib/open_vidu/command.rb', line 8 def server @server end |
Instance Method Details
#execute ⇒ Object
21 22 23 24 25 |
# File 'lib/open_vidu/command.rb', line 21 def execute response = requestor.execute raise OpenVidu::ResponseError.new(response) unless valid?(response) responder.execute(server, object, response.parsed_response) end |