Module: ActsAsKaltura::Client
- Extended by:
- ActiveSupport::Concern
- Included in:
- ActiveRecord::Base
- Defined in:
- lib/acts_as_kaltura/client.rb
Defined Under Namespace
Modules: ClassMethods Classes: Logger
Instance Method Summary collapse
- #_create_kaltura_client ⇒ Object
-
#kaltura_client ⇒ Object
Find an existing client instance or create one based on :setting_scope configuration.
-
#local_or_global_kaltura_client ⇒ Object
Find local kaltura client instance if overrode over :setting_scope otherwise return the global client instance.
Instance Method Details
#_create_kaltura_client ⇒ Object
37 38 39 40 41 42 43 44 45 46 |
# File 'lib/acts_as_kaltura/client.rb', line 37 def _create_kaltura_client config_callback = self.[:setting_scope] unless config_callback.present? raise "acts_as_kaltura_... :setting_scope => ... is not defined." end configs = config_callback.call(self) self.class.create_kaltura_client(configs) end |
#kaltura_client ⇒ Object
Find an existing client instance or create one based on :setting_scope configuration. Returns kaltura client instance.
23 24 25 |
# File 'lib/acts_as_kaltura/client.rb', line 23 def kaltura_client @kaltura_client ||= _create_kaltura_client end |
#local_or_global_kaltura_client ⇒ Object
Find local kaltura client instance if overrode over :setting_scope otherwise return the global client instance
29 30 31 32 33 34 35 |
# File 'lib/acts_as_kaltura/client.rb', line 29 def local_or_global_kaltura_client if self.class.overrode_kaltura_client? self.kaltura_client else self.class.kaltura_client end end |