Class: Songkick::Transport::Base
- Inherits:
-
Object
- Object
- Songkick::Transport::Base
show all
- Defined in:
- lib/songkick/transport/base.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#user_agent ⇒ Object
Returns the value of attribute user_agent.
5
6
7
|
# File 'lib/songkick/transport/base.rb', line 5
def user_agent
@user_agent
end
|
#user_error_codes ⇒ Object
Returns the value of attribute user_error_codes.
5
6
7
|
# File 'lib/songkick/transport/base.rb', line 5
def user_error_codes
@user_error_codes
end
|
Instance Method Details
#do_verb(verb, path, params = {}, head = {}, timeout = nil) ⇒ Object
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
|
# File 'lib/songkick/transport/base.rb', line 15
def do_verb(verb, path, params = {}, head = {}, timeout = nil)
req = Request.new(endpoint, verb, path, params, .merge(head), timeout)
Reporting.log_request(req)
begin
req.response = execute_request(req)
rescue => error
req.error = error
Reporting.record(req)
raise error
end
Reporting.log_response(req)
Reporting.record(req)
req.response
end
|
32
33
34
|
# File 'lib/songkick/transport/base.rb', line 32
def ( = {})
HeaderDecorator.new(self, )
end
|
#with_timeout(timeout = DEFAULT_TIMEOUT) ⇒ Object