Class: Tankard::Client

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

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client



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

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



19
20
21
# File 'lib/tankard/client.rb', line 19

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

#beers(options = {}) ⇒ Object



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

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

#search(options = {}) ⇒ Object



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

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

#style(options = {}) ⇒ Object



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

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

#stylesObject



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

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