Class: Tankard::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/tankard/client.rb

Overview

Interaction point for various endpoints When querying Tankard normally there is only one of these alive at a time

Author:

  • Matthew Shafer

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



15
16
17
18
19
20
21
# File 'lib/tankard/client.rb', line 15

def initialize(options = {})
  Tankard::Configuration::KEYS.each do |key|
    instance_variable_set(:"@#{key}", options[key])
  end

  @tankard_request = Tankard::Request.new(@api_key)
end

Instance Method Details

#beer(options = {}) ⇒ Object



23
24
25
# File 'lib/tankard/client.rb', line 23

def beer(options = {})
  Tankard::Api::Beer.new(@tankard_request, options)
end

#beers(options = {}) ⇒ Object



27
28
29
# File 'lib/tankard/client.rb', line 27

def beers(options = {})
  Tankard::Api::Beers.new(@tankard_request, options)
end

#search(options = {}) ⇒ Object



31
32
33
# File 'lib/tankard/client.rb', line 31

def search(options = {})
  Tankard::Api::Search.new(@tankard_request, options)
end

#style(options = {}) ⇒ Object



39
40
41
# File 'lib/tankard/client.rb', line 39

def style(options = {})
  Tankard::Api::Style.new(@tankard_request, options)
end

#stylesObject



35
36
37
# File 'lib/tankard/client.rb', line 35

def styles
  Tankard::Api::Styles.new(@tankard_request)
end