Class: Weibo2::Error

Inherits:
OAuth2::Error
  • Object
show all
Defined in:
lib/weibo2/error.rb

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ Error

Returns a new instance of Error.



4
5
6
7
8
9
10
11
# File 'lib/weibo2/error.rb', line 4

def initialize(response)
  response.error = self
  @response = response
  if response.parsed.is_a?(Hash)
    @code = response.parsed['error_code']
    @description = response.parsed['error']
  end
end