Class: OpenVidu::Base
- Inherits:
-
Object
- Object
- OpenVidu::Base
- Defined in:
- lib/open_vidu/base.rb
Overview
Base
Constant Summary collapse
- ASSIGNABLE_PARAMS =
%w[].freeze
- GENERATED_PARAMS =
%w[].freeze
- ALL_PARAMS =
(ASSIGNABLE_PARAMS + GENERATED_PARAMS).freeze
Instance Attribute Summary collapse
-
#server ⇒ Object
readonly
Returns the value of attribute server.
Class Method Summary collapse
Instance Method Summary collapse
- #create_params ⇒ Object
-
#initialize(uri, params = {}) ⇒ Base
constructor
A new instance of Base.
Constructor Details
#initialize(uri, params = {}) ⇒ Base
Returns a new instance of Base.
17 18 19 20 21 22 23 |
# File 'lib/open_vidu/base.rb', line 17 def initialize(uri, params = {}) @server = Server.new(uri).freeze self.class::ALL_PARAMS.each do |param| instance_variable_set("@#{param}", params[param.to_sym]) self.class.send(:attr_accessor, param.to_sym) end end |
Instance Attribute Details
#server ⇒ Object (readonly)
Returns the value of attribute server.
11 12 13 |
# File 'lib/open_vidu/base.rb', line 11 def server @server end |
Class Method Details
.content_key ⇒ Object
13 14 15 |
# File 'lib/open_vidu/base.rb', line 13 def self.content_key 'content' end |
Instance Method Details
#create_params ⇒ Object
25 26 27 28 29 30 31 |
# File 'lib/open_vidu/base.rb', line 25 def create_params Hash[ self.class::ASSIGNABLE_PARAMS.map do |param| [param, instance_variable_get("@#{param}")] end ] end |