Exception: LinkedIn::ServiceError
- Inherits:
-
Error
- Object
- StandardError
- Error
- LinkedIn::ServiceError
show all
- Defined in:
- lib/linkedin/errors.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Constructor Details
#initialize(response = {}) ⇒ ServiceError
Returns a new instance of ServiceError.
7
8
9
|
# File 'lib/linkedin/errors.rb', line 7
def initialize(response = {})
@source = Hashie::Mash.new response
end
|
Instance Attribute Details
#source ⇒ Object
Returns the value of attribute source.
5
6
7
|
# File 'lib/linkedin/errors.rb', line 5
def source
@source
end
|
Instance Method Details
#body ⇒ Object
20
21
22
|
# File 'lib/linkedin/errors.rb', line 20
def body
response.body
end
|
#message ⇒ Object
11
12
13
14
|
# File 'lib/linkedin/errors.rb', line 11
def message
return self.class.name if body.message.empty?
body.message
end
|
#request ⇒ Object
24
25
26
|
# File 'lib/linkedin/errors.rb', line 24
def request
@request ||= Hashie::Mash.new url: source.url, headers: source., params: source.params
end
|
#response ⇒ Object
28
29
30
|
# File 'lib/linkedin/errors.rb', line 28
def response
@response ||= Hashie::Mash.new status: source.status, body: source.body, headers: source.
end
|
#status ⇒ Object
16
17
18
|
# File 'lib/linkedin/errors.rb', line 16
def status
response.status
end
|