Module: Tankard::Configuration

Included in:
Tankard
Defined in:
lib/tankard/configuration.rb

Overview

Configuring and validating credentials

Author:

  • Matthew Shafer

Constant Summary collapse

KEYS =
[:api_key]
BREWERYDB_URL =
'http://api.brewerydb.com/v2/'

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#api_key=(value) ⇒ Object (writeonly)

Sets the attribute api_key

Parameters:

  • value

    the value to set the attribute api_key to.



6
7
8
# File 'lib/tankard/configuration.rb', line 6

def api_key=(value)
  @api_key = value
end

Instance Method Details

#configure {|_self| ... } ⇒ Object

Yields:

  • (_self)

Yield Parameters:



11
12
13
14
15
16
# File 'lib/tankard/configuration.rb', line 11

def configure
  yield self
  validate_api_key!
  reset_client
  self
end