Module: KalturaFu::Configuration
- Included in:
- KalturaFu
- Defined in:
- lib/kaltura_fu/configuration.rb
Constant Summary collapse
- @@config =
A Has containing the Kaltura server information
{}
- @@client =
An insantiated Kaltura::Client class
nil
- @@client_configuration =
Configuration values for the @@client.
nil
- @@session_key =
The Kaltura ks to use.
nil
Instance Method Summary collapse
- #check_for_client_session ⇒ Object
-
#clear_session_key! ⇒ Object
Clears the current Kaltura ks.
- #client ⇒ Object
- #client=(value) ⇒ Object
- #client_configuration ⇒ Object
- #client_configuration=(value) ⇒ Object
- #config ⇒ Object
- #config=(value) ⇒ Object
- #create_client ⇒ Object
- #create_client_config ⇒ Object
-
#generate_session_key ⇒ String
Generates a Kaltura ks and adds it to the KalturaFu client object.
- #session_key ⇒ Object
Instance Method Details
#check_for_client_session ⇒ Object
81 82 83 84 85 86 87 88 89 |
# File 'lib/kaltura_fu/configuration.rb', line 81 def check_for_client_session if @@client.nil? self.create_client self.generate_session_key true else true end end |
#clear_session_key! ⇒ Object
Clears the current Kaltura ks.
74 75 76 |
# File 'lib/kaltura_fu/configuration.rb', line 74 def clear_session_key! @@session_key = nil end |
#client ⇒ Object
17 18 19 |
# File 'lib/kaltura_fu/configuration.rb', line 17 def client @@client ||= nil end |
#client=(value) ⇒ Object
21 22 23 |
# File 'lib/kaltura_fu/configuration.rb', line 21 def client=(value) @@client = value end |
#client_configuration ⇒ Object
25 26 27 |
# File 'lib/kaltura_fu/configuration.rb', line 25 def client_configuration @@client_configuration ||= nil end |
#client_configuration=(value) ⇒ Object
28 29 30 |
# File 'lib/kaltura_fu/configuration.rb', line 28 def client_configuration=(value) @@client_configuration = value end |
#config ⇒ Object
9 10 11 |
# File 'lib/kaltura_fu/configuration.rb', line 9 def config @@config ||= {} end |
#config=(value) ⇒ Object
13 14 15 |
# File 'lib/kaltura_fu/configuration.rb', line 13 def config=(value) @@config = value end |
#create_client ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/kaltura_fu/configuration.rb', line 51 def create_client if @@client_configuration.nil? self.create_client_config end @@client = Kaltura::Client.new(@@client_configuration) @@client end |
#create_client_config ⇒ Object
39 40 41 42 43 44 45 46 |
# File 'lib/kaltura_fu/configuration.rb', line 39 def create_client_config raise "Missing Partner Identifier" unless @@config[:partner_id] @@client_configuration = Kaltura::Configuration.new(@@config[:partner_id]) unless @@config[:service_url].nil? @@client_configuration.service_url = @@config[:service_url] end @@client_configuration end |
#generate_session_key ⇒ String
Generates a Kaltura ks and adds it to the KalturaFu client object.
64 65 66 67 68 69 70 |
# File 'lib/kaltura_fu/configuration.rb', line 64 def generate_session_key self.check_for_client_session raise "Missing Administrator Secret" unless @@config[:administrator_secret] @@session_key = @@client.session_service.start(@@config[:administrator_secret],'',Kaltura::Constants::SessionType::ADMIN, @@config[:partner_id], 86400, "edit:*" ) @@client.ks = @@session_key end |
#session_key ⇒ Object
31 32 33 |
# File 'lib/kaltura_fu/configuration.rb', line 31 def session_key @@session_key ||=nil end |