Class: Authograph::Adapters::Faraday
- Defined in:
- lib/authograph/adapters/faraday.rb
Instance Method Summary collapse
- #body ⇒ Object
- #content_type ⇒ Object
- #get_header(_header) ⇒ Object
-
#initialize(_request) ⇒ Faraday
constructor
A new instance of Faraday.
- #method ⇒ Object
- #path ⇒ Object
- #set_header(_header, _value) ⇒ Object
Constructor Details
#initialize(_request) ⇒ Faraday
Returns a new instance of Faraday.
3 4 5 |
# File 'lib/authograph/adapters/faraday.rb', line 3 def initialize(_request) @request = _request end |
Instance Method Details
#body ⇒ Object
29 30 31 |
# File 'lib/authograph/adapters/faraday.rb', line 29 def body @request.body end |
#content_type ⇒ Object
25 26 27 |
# File 'lib/authograph/adapters/faraday.rb', line 25 def content_type @request.headers['Content-Type'] || 'application/x-www-form-urlencoded' end |
#get_header(_header) ⇒ Object
7 8 9 |
# File 'lib/authograph/adapters/faraday.rb', line 7 def get_header(_header) @request.headers[_header] end |
#method ⇒ Object
15 16 17 |
# File 'lib/authograph/adapters/faraday.rb', line 15 def method @request.http_method.to_s.upcase end |
#path ⇒ Object
19 20 21 22 23 |
# File 'lib/authograph/adapters/faraday.rb', line 19 def path uri = URI(@request.path) uri.query = ::Faraday::Utils.build_query(@request.params) unless @request.params.empty? uri.request_uri end |
#set_header(_header, _value) ⇒ Object
11 12 13 |
# File 'lib/authograph/adapters/faraday.rb', line 11 def set_header(_header, _value) @request.headers[_header] = _value end |