Attributes
| auth_token_value | [R] |
Public Class methods
new(*)
[show source]
# File lib/httpx/plugins/auth.rb 148 def initialize(*) 149 super 150 @auth_token_value = @auth_header_value = nil 151 end
Public Instance methods
authorize(auth_value)
[show source]
# File lib/httpx/plugins/auth.rb 165 def authorize(auth_value) 166 @auth_header_value = auth_value 167 if (auth_type = @options.auth_header_type) 168 @auth_header_value = "#{auth_type} #{@auth_header_value}" 169 end 170 171 @headers.add("authorization", @auth_header_value) 172 173 @auth_token_value = auth_value 174 end
authorized?()
[show source]
# File lib/httpx/plugins/auth.rb 153 def authorized? 154 !@auth_token_value.nil? 155 end
unauthorize!()
[show source]
# File lib/httpx/plugins/auth.rb 157 def unauthorize! 158 return unless (auth_value = @auth_header_value) 159 160 @headers.get("authorization").delete(auth_value) 161 162 @auth_token_value = @auth_header_value = nil 163 end