Class: Buzz::Configuration
- Inherits:
-
Object
- Object
- Buzz::Configuration
- Defined in:
- lib/buzz/configuration.rb
Instance Attribute Summary collapse
-
#account_id ⇒ Object
Returns the value of attribute account_id.
- #base_url ⇒ Object
-
#buzz_key ⇒ Object
Returns the value of attribute buzz_key.
-
#email ⇒ Object
Returns the value of attribute email.
-
#keep_logged_in ⇒ Object
Returns the value of attribute keep_logged_in.
-
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
-
#password ⇒ Object
Returns the value of attribute password.
-
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
-
#timezone ⇒ Object
Returns the value of attribute timezone.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #validate! ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
9 10 11 12 13 |
# File 'lib/buzz/configuration.rb', line 9 def initialize @keep_logged_in = true @open_timeout = 10 @read_timeout = 30 end |
Instance Attribute Details
#account_id ⇒ Object
Returns the value of attribute account_id.
5 6 7 |
# File 'lib/buzz/configuration.rb', line 5 def account_id @account_id end |
#base_url ⇒ Object
15 16 17 |
# File 'lib/buzz/configuration.rb', line 15 def base_url @base_url || "https://#{buzz_key}.api.beeswax.com" end |
#buzz_key ⇒ Object
Returns the value of attribute buzz_key.
5 6 7 |
# File 'lib/buzz/configuration.rb', line 5 def buzz_key @buzz_key end |
#email ⇒ Object
Returns the value of attribute email.
5 6 7 |
# File 'lib/buzz/configuration.rb', line 5 def email @email end |
#keep_logged_in ⇒ Object
Returns the value of attribute keep_logged_in.
5 6 7 |
# File 'lib/buzz/configuration.rb', line 5 def keep_logged_in @keep_logged_in end |
#open_timeout ⇒ Object
Returns the value of attribute open_timeout.
5 6 7 |
# File 'lib/buzz/configuration.rb', line 5 def open_timeout @open_timeout end |
#password ⇒ Object
Returns the value of attribute password.
5 6 7 |
# File 'lib/buzz/configuration.rb', line 5 def password @password end |
#read_timeout ⇒ Object
Returns the value of attribute read_timeout.
5 6 7 |
# File 'lib/buzz/configuration.rb', line 5 def read_timeout @read_timeout end |
#timezone ⇒ Object
Returns the value of attribute timezone.
5 6 7 |
# File 'lib/buzz/configuration.rb', line 5 def timezone @timezone end |
Instance Method Details
#validate! ⇒ Object
19 20 21 22 23 |
# File 'lib/buzz/configuration.rb', line 19 def validate! raise ArgumentError, "buzz_key is required" unless buzz_key && !buzz_key.empty? raise ArgumentError, "email is required" unless email && !email.empty? raise ArgumentError, "password is required" unless password && !password.empty? end |