Class: AFHTTPRequestSerializer
- Inherits:
-
Object
- Object
- AFHTTPRequestSerializer
- Defined in:
- lib/afmotion/serializer.rb
Defined Under Namespace
Classes: HeaderWrapper
Instance Method Summary collapse
-
#authorization=(options = {}) ⇒ Object
options can be - _, password: __ or - {token: _ }.
- #headers ⇒ Object
Instance Method Details
#authorization=(options = {}) ⇒ Object
options can be
-
_, password: __
or
-
{token: _ }
30 31 32 33 34 35 36 37 38 39 40 |
# File 'lib/afmotion/serializer.rb', line 30 def ( = {}) if .nil? clearAuthorizationHeader elsif [:username] && [:password] setAuthorizationHeaderFieldWithUsername([:username], password: [:password]) elsif [:token] setAuthorizationHeaderFieldWithToken([:token]) else raise "Not a valid authorization hash: #{.inspect}" end end |
#headers ⇒ Object
22 23 24 |
# File 'lib/afmotion/serializer.rb', line 22 def headers @header_wrapper ||= HeaderWrapper.new(self) end |