Module: DmCloud
- Defined in:
- lib/dmcloud.rb,
lib/dm_cloud/media.rb,
lib/dm_cloud/request.rb,
lib/dm_cloud/signing.rb,
lib/dm_cloud/version.rb,
lib/dm_cloud/streaming.rb,
lib/dm_cloud/builder/media.rb
Overview
This module generate methods to generate video’s fluxes before signing it and request it.
Defined Under Namespace
Modules: Builder Classes: Media, Request, Signing, Streaming
Constant Summary collapse
- YAML_INITIALIZER_PATH =
File.dirname(__FILE__)
- VERSION =
"0.0.65"
- @@config =
Configuration defaults I used this parts from Slainer68 paybox_system gem. I liked the concept and how he handle this part. Thx Slainer68, I created my first gem, and next one will be an update to your paybox_system gem.
{ security_level: 'none', protocol: 'http', auto_call: true, user_key: nil, secret_key: nil }
Class Method Summary collapse
-
.config ⇒ Object
Access to config variables (security level, user_id and api_key).
-
.configure(opts = {}) ⇒ Object
Configure through hash.
-
.configure_with(yaml_file_path = nil) ⇒ Object
Configure through yaml file for ruby scripting usage.
Class Method Details
.config ⇒ Object
Access to config variables (security level, user_id and api_key)
46 47 48 49 |
# File 'lib/dmcloud.rb', line 46 def self.config @@config = configure unless @@config @@config end |
.configure(opts = {}) ⇒ Object
Configure through hash
26 27 28 |
# File 'lib/dmcloud.rb', line 26 def self.configure(opts = {}) opts.each {|k,v| @@config[k.to_sym] = v } # if @valid_config_keys.include? k.to_sym} end |
.configure_with(yaml_file_path = nil) ⇒ Object
Configure through yaml file for ruby scripting usage
32 33 34 35 36 37 38 39 40 41 42 43 |
# File 'lib/dmcloud.rb', line 32 def self.configure_with(yaml_file_path = nil) yaml_file_path = YAML_INITIALIZER_PATH unless yaml_file_path begin config = YAML::load(IO.read(path_to_yaml_file)) rescue Errno::ENOENT log(:warning, "YAML configuration file couldn't be found. Using defaults."); return rescue Psych::SyntaxError log(:warning, "YAML configuration file contains invalid syntax. Using defaults."); return end configure(config) end |