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