Class: CloudfilesCli::Config
- Inherits:
-
Object
- Object
- CloudfilesCli::Config
- Defined in:
- lib/cloudfiles_cli/config.rb
Instance Attribute Summary collapse
-
#options ⇒ Object
readonly
Returns the value of attribute options.
Instance Method Summary collapse
- #api_key ⇒ Object
- #auth_url ⇒ Object
- #hash ⇒ Object
-
#initialize(options) ⇒ Config
constructor
A new instance of Config.
- #region ⇒ Object
- #username ⇒ Object
Constructor Details
#initialize(options) ⇒ Config
Returns a new instance of Config.
4 5 6 |
# File 'lib/cloudfiles_cli/config.rb', line 4 def initialize() = end |
Instance Attribute Details
#options ⇒ Object (readonly)
Returns the value of attribute options.
3 4 5 |
# File 'lib/cloudfiles_cli/config.rb', line 3 def end |
Instance Method Details
#api_key ⇒ Object
12 13 14 |
# File 'lib/cloudfiles_cli/config.rb', line 12 def api_key [:api_key] || ENV['CLOUDFILES_API_KEY'] || raise("No api key provided") end |
#auth_url ⇒ Object
16 17 18 |
# File 'lib/cloudfiles_cli/config.rb', line 16 def auth_url [:auth_url] || ENV['CLOUDFILES_AUTH_URL'] || raise("No auth url provided") end |
#hash ⇒ Object
25 26 27 28 29 30 31 32 |
# File 'lib/cloudfiles_cli/config.rb', line 25 def hash { :rackspace_username => username, :rackspace_api_key => api_key, :rackspace_auth_url => auth_url, :rackspace_region => region.to_sym, } end |
#region ⇒ Object
20 21 22 |
# File 'lib/cloudfiles_cli/config.rb', line 20 def region [:region] || ENV['CLOUDFILES_REGION'] || raise("No region provided") end |
#username ⇒ Object
8 9 10 |
# File 'lib/cloudfiles_cli/config.rb', line 8 def username [:username] || ENV['CLOUDFILES_USERNAME'] || raise("No username provided") end |