Class: Sixpack::Configuration
- Inherits:
-
Object
- Object
- Sixpack::Configuration
- Defined in:
- lib/sixpack/configuration.rb
Instance Attribute Summary collapse
-
#base_url ⇒ Object
Returns the value of attribute base_url.
-
#password ⇒ Object
Returns the value of attribute password.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_hash ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 |
# File 'lib/sixpack/configuration.rb', line 5 def initialize @base_url = 'http://localhost:5000' end |
Instance Attribute Details
#base_url ⇒ Object
Returns the value of attribute base_url.
3 4 5 |
# File 'lib/sixpack/configuration.rb', line 3 def base_url @base_url end |
#password ⇒ Object
Returns the value of attribute password.
3 4 5 |
# File 'lib/sixpack/configuration.rb', line 3 def password @password end |
#user ⇒ Object
Returns the value of attribute user.
3 4 5 |
# File 'lib/sixpack/configuration.rb', line 3 def user @user end |
Instance Method Details
#to_hash ⇒ Object
9 10 11 12 13 14 |
# File 'lib/sixpack/configuration.rb', line 9 def to_hash config = {base_url: @base_url} config[:user] = @user unless @user.nil? config[:password] = @password unless @password.nil? config end |