Class: KalturaBox::Client
- Inherits:
-
Object
- Object
- KalturaBox::Client
- Defined in:
- lib/kaltura_box/client.rb
Instance Attribute Summary collapse
-
#client ⇒ Object
Returns the value of attribute client.
-
#client_config ⇒ Object
Returns the value of attribute client_config.
-
#session_key ⇒ Object
Returns the value of attribute session_key.
Class Method Summary collapse
Instance Attribute Details
#client ⇒ Object
Returns the value of attribute client.
6 7 8 |
# File 'lib/kaltura_box/client.rb', line 6 def client @client end |
#client_config ⇒ Object
Returns the value of attribute client_config.
6 7 8 |
# File 'lib/kaltura_box/client.rb', line 6 def client_config @client_config end |
#session_key ⇒ Object
Returns the value of attribute session_key.
6 7 8 |
# File 'lib/kaltura_box/client.rb', line 6 def session_key @session_key end |
Class Method Details
.create ⇒ Object
10 11 12 13 14 15 |
# File 'lib/kaltura_box/client.rb', line 10 def create self.setup_config unless @client_config @client = Kaltura::KalturaClient.new(@client_config) @client.ks = @session_key @client end |
.generate_session_key ⇒ Object
27 28 29 30 31 32 33 34 35 36 |
# File 'lib/kaltura_box/client.rb', line 27 def generate_session_key self.update_session raise "Missing Administrator Secret" unless KalturaBox.config.administrator_secret begin @session_key = @client.session_service.start(KalturaBox.config.administrator_secret, '', Kaltura::KalturaSessionType::ADMIN, KalturaBox.config.partner_id, 315360000) rescue Kaltura::KalturaAPIError => e puts e. end end |
.setup_config ⇒ Object
17 18 19 20 21 22 23 24 25 |
# File 'lib/kaltura_box/client.rb', line 17 def setup_config raise "Missing Partner Identifier" unless KalturaBox.config.partner_id @client_config = Kaltura::KalturaConfiguration.new(KalturaBox.config.partner_id) @client_config.service_url = KalturaBox.config.service_url self.generate_session_key @client_config end |
.update_session ⇒ Object
38 39 40 |
# File 'lib/kaltura_box/client.rb', line 38 def update_session @client ? @client : self.create end |