Class: Watsbot::Configuration
- Inherits:
-
Object
- Object
- Watsbot::Configuration
- Defined in:
- lib/watsbot/configuration.rb
Instance Attribute Summary collapse
-
#base_uri ⇒ Object
Returns the value of attribute base_uri.
-
#password ⇒ Object
Returns the value of attribute password.
-
#redis_url ⇒ Object
Returns the value of attribute redis_url.
-
#username ⇒ Object
Returns the value of attribute username.
-
#version ⇒ Object
Returns the value of attribute version.
-
#workspace ⇒ Object
Returns the value of attribute workspace.
Instance Method Summary collapse
-
#initialize(*args) {|_self| ... } ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(*args) {|_self| ... } ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 13 14 |
# File 'lib/watsbot/configuration.rb', line 5 def initialize(*args, &block) arg = args.pop || {} @username = arg[:username] || ENV["WATSON_USERNAME"] @password = arg[:password] || ENV["WATSON_PASSWORD"] @workspace = arg[:workspace] || ENV["WATSON_WORKSPACE"] @version = arg[:version] || ENV["WATSON_WORKSPACE_VERSION"] @base_uri = BASE_URI @redis_url = arg[:redis_url] || ENV["REDIS_URL"] yield self if block_given? end |
Instance Attribute Details
#base_uri ⇒ Object
Returns the value of attribute base_uri.
3 4 5 |
# File 'lib/watsbot/configuration.rb', line 3 def base_uri @base_uri end |
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/watsbot/configuration.rb', line 3 def password @password end |
#redis_url ⇒ Object
Returns the value of attribute redis_url.
3 4 5 |
# File 'lib/watsbot/configuration.rb', line 3 def redis_url @redis_url end |
#username ⇒ Object
Returns the value of attribute username.
3 4 5 |
# File 'lib/watsbot/configuration.rb', line 3 def username @username end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/watsbot/configuration.rb', line 3 def version @version end |
#workspace ⇒ Object
Returns the value of attribute workspace.
3 4 5 |
# File 'lib/watsbot/configuration.rb', line 3 def workspace @workspace end |