Exception: Embedly::BadResponseException

Inherits:
RuntimeError
  • Object
show all
Defined in:
lib/embedly/exceptions.rb

Instance Attribute Summary (collapse)

Instance Method Summary (collapse)

Constructor Details

- (BadResponseException) initialize(response, path = nil)

A new instance of BadResponseException



4
5
6
7
# File 'lib/embedly/exceptions.rb', line 4

def initialize(response, path = nil)
  @response ||= response
  @path ||= path
end

Instance Attribute Details

- (Object) path

Returns the value of attribute path



2
3
4
# File 'lib/embedly/exceptions.rb', line 2

def path
  @path
end

- (Object) response

Returns the value of attribute response



2
3
4
# File 'lib/embedly/exceptions.rb', line 2

def response
  @response
end

Instance Method Details

- (Object) inspect



13
14
15
# File 'lib/embedly/exceptions.rb', line 13

def inspect
  self.message
end

- (Object) message



9
10
11
# File 'lib/embedly/exceptions.rb', line 9

def message
  "Bad Response : #{@response.inspect} for path: #{@path.inspect}"
end

- (Object) to_s



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

def to_s
  self.message
end