Exception: Cocoafish::CocoafishError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/cocoafish.rb

Instance Method Summary collapse

Constructor Details

#initialize(e) ⇒ CocoafishError

Returns a new instance of CocoafishError.



17
18
19
# File 'lib/cocoafish.rb', line 17

def initialize(e)
  @re = e
end

Instance Method Details

#http_codeObject



26
27
28
# File 'lib/cocoafish.rb', line 26

def http_code
  @re.http_code
end

#responseObject



30
31
32
# File 'lib/cocoafish.rb', line 30

def response
  @re.response
end

#to_sObject



21
22
23
24
# File 'lib/cocoafish.rb', line 21

def to_s
  content = JSON.parse(@re.response)
  "#{@re.message} - #{content['meta']['message']}"
end