Class: Buzz::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/buzz/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

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_idObject

Returns the value of attribute account_id.



5
6
7
# File 'lib/buzz/configuration.rb', line 5

def 
  @account_id
end

#base_urlObject



15
16
17
# File 'lib/buzz/configuration.rb', line 15

def base_url
  @base_url || "https://#{buzz_key}.api.beeswax.com"
end

#buzz_keyObject

Returns the value of attribute buzz_key.



5
6
7
# File 'lib/buzz/configuration.rb', line 5

def buzz_key
  @buzz_key
end

#emailObject

Returns the value of attribute email.



5
6
7
# File 'lib/buzz/configuration.rb', line 5

def email
  @email
end

#keep_logged_inObject

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_timeoutObject

Returns the value of attribute open_timeout.



5
6
7
# File 'lib/buzz/configuration.rb', line 5

def open_timeout
  @open_timeout
end

#passwordObject

Returns the value of attribute password.



5
6
7
# File 'lib/buzz/configuration.rb', line 5

def password
  @password
end

#read_timeoutObject

Returns the value of attribute read_timeout.



5
6
7
# File 'lib/buzz/configuration.rb', line 5

def read_timeout
  @read_timeout
end

#timezoneObject

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

Raises:

  • (ArgumentError)


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