Class: Qiniu2Upyun::Config::Qiniu

Inherits:
Object
  • Object
show all
Defined in:
lib/qiniu2upyun/config.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Qiniu

Returns a new instance of Qiniu.



6
7
8
9
10
11
# File 'lib/qiniu2upyun/config.rb', line 6

def initialize(options)
  @access_key = options['access_key']
  @secret_key = options['secret_key']
  @bucket     = options['bucket']
  @domain     = options['domain'] || default_domain
end

Instance Attribute Details

#access_keyObject (readonly)

Returns the value of attribute access_key.



4
5
6
# File 'lib/qiniu2upyun/config.rb', line 4

def access_key
  @access_key
end

#bucketObject (readonly)

Returns the value of attribute bucket.



4
5
6
# File 'lib/qiniu2upyun/config.rb', line 4

def bucket
  @bucket
end

#domainObject (readonly)

Returns the value of attribute domain.



4
5
6
# File 'lib/qiniu2upyun/config.rb', line 4

def domain
  @domain
end

#secret_keyObject (readonly)

Returns the value of attribute secret_key.



4
5
6
# File 'lib/qiniu2upyun/config.rb', line 4

def secret_key
  @secret_key
end

Instance Method Details

#default_domainObject



13
14
15
# File 'lib/qiniu2upyun/config.rb', line 13

def default_domain
  "http://#{bucket}.qiniudn.com"
end