Module: Qiniu::S3::Config
- Defined in:
- lib/qiniu/s3/config.rb
Constant Summary collapse
- DEFAULT_OPTIONS =
{ :user_agent => 'Qiniu-S3-Ruby-SDK-' + VERSION + '()', :method => :post, :content_type => 'application/x-www-form-urlencoded', :auth_url => "https://acc.qbox.me/oauth2/token", :rs_host => "http://rs.qbox.me:10100", :io_host => "http://io.qbox.me", :client_id => "<YOUR_APP_CLIENT_ID>", :client_secret => "<YOUR_APP_CLIENT_SECRET>", :auto_reconnect => true, :max_retry_times => 5 }
- REQUIRED_OPTION_KEYS =
[:client_id, :client_secret, :auth_url, :rs_host, :io_host]
Class Attribute Summary collapse
-
.default_params ⇒ Object
readonly
Returns the value of attribute default_params.
-
.settings ⇒ Object
readonly
Returns the value of attribute settings.
Class Method Summary collapse
Class Attribute Details
.default_params ⇒ Object (readonly)
Returns the value of attribute default_params.
33 34 35 |
# File 'lib/qiniu/s3/config.rb', line 33 def default_params @default_params end |
.settings ⇒ Object (readonly)
Returns the value of attribute settings.
33 34 35 |
# File 'lib/qiniu/s3/config.rb', line 33 def settings @settings end |
Class Method Details
.initialize_connect(options = {}) ⇒ Object
44 45 46 47 48 49 |
# File 'lib/qiniu/s3/config.rb', line 44 def initialize_connect = {} @settings = DEFAULT_OPTIONS.merge() REQUIRED_OPTION_KEYS.each do |opt| raise MissingArgsError, [opt] unless @settings.has_key?(opt) end end |
.load(config_file) ⇒ Object
35 36 37 38 39 40 41 42 |
# File 'lib/qiniu/s3/config.rb', line 35 def load config_file if File.exist?(config_file) = YAML.load_file(config_file) initialize_connect() else raise MissingConfError, config_file end end |