Class: BreweryDB::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/brewery_db/config.rb

Constant Summary collapse

BASE_URI =
'http://api.brewerydb.com/v2'
USER_AGENT =
"BreweryDB Ruby Gem #{BreweryDB::VERSION}"
TIMEOUT =
60

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeConfig

Returns a new instance of Config.



15
16
17
18
19
20
# File 'lib/brewery_db/config.rb', line 15

def initialize
  self.adapter = Faraday.default_adapter
  self.base_uri = BASE_URI
  self.timeout = TIMEOUT
  self.user_agent = USER_AGENT
end

Instance Attribute Details

#adapterObject

Returns the value of attribute adapter.



9
10
11
# File 'lib/brewery_db/config.rb', line 9

def adapter
  @adapter
end

#api_keyObject

Returns the value of attribute api_key.



10
11
12
# File 'lib/brewery_db/config.rb', line 10

def api_key
  @api_key
end

#base_uriObject

Returns the value of attribute base_uri.



11
12
13
# File 'lib/brewery_db/config.rb', line 11

def base_uri
  @base_uri
end

#timeoutObject

Returns the value of attribute timeout.



12
13
14
# File 'lib/brewery_db/config.rb', line 12

def timeout
  @timeout
end

#user_agentObject

Returns the value of attribute user_agent.



13
14
15
# File 'lib/brewery_db/config.rb', line 13

def user_agent
  @user_agent
end