Class: Bartender::Configuration

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

Overview

Used to store settings for API connections and requests.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfiguration

Instantiated from Bartender.configuration. Sets defaults.


23
24
25
26
27
28
# File 'lib/bartender/configuration.rb', line 23

def initialize
  self.host              = "api.openbeerdatabase.com"
  self.port              = 80
  self.http_open_timeout = 2
  self.http_read_timeout = 2
end

Instance Attribute Details

#hostString

Returns The host to connect to (defaults to api.openbeerdatabase.com).

Returns:

  • (String)

    The host to connect to (defaults to api.openbeerdatabase.com).


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

def host
  @host
end

#http_open_timeoutFixnum

Returns The HTTP open timeout in seconds (defaults to 2).

Returns:

  • (Fixnum)

    The HTTP open timeout in seconds (defaults to 2).


17
18
19
# File 'lib/bartender/configuration.rb', line 17

def http_open_timeout
  @http_open_timeout
end

#http_read_timeoutFixnum

Returns The HTTP read timeout in seconds (defaults to 2).

Returns:

  • (Fixnum)

    The HTTP read timeout in seconds (defaults to 2).


20
21
22
# File 'lib/bartender/configuration.rb', line 20

def http_read_timeout
  @http_read_timeout
end

#portFixnum

Returns The port on which the Open Beer Database API runs (defaults to 80).

Returns:

  • (Fixnum)

    The port on which the Open Beer Database API runs (defaults to 80).


8
9
10
# File 'lib/bartender/configuration.rb', line 8

def port
  @port
end

#private_tokenString

Returns The private API token for your user.

Returns:

  • (String)

    The private API token for your user.


14
15
16
# File 'lib/bartender/configuration.rb', line 14

def private_token
  @private_token
end

#public_tokenString

Returns The public API token for your user.

Returns:

  • (String)

    The public API token for your user.


11
12
13
# File 'lib/bartender/configuration.rb', line 11

def public_token
  @public_token
end