Class: Beerbelly::Client::Error

Inherits:
Struct
  • Object
show all
Defined in:
lib/beerbelly/client/error.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#codeObject

Returns the value of attribute code

Returns:

  • (Object)

    the current value of code



5
6
7
# File 'lib/beerbelly/client/error.rb', line 5

def code
  @code
end

Instance Method Details

#to_sObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/beerbelly/client/error.rb', line 6

def to_s
  case code
  when 400
    'Invalid query'
  when 401
    'Unauthorized'
  when 404
    'Not found'
  when 406
    'Invalid format'
  end
end