Internal
# File lib/faraday/request/authorization.rb, line 18 def self.build_hash(type, hash) offset = KEY.size + type.size + 3 comma = ",\n#{' ' * offset}" values = [] hash.each do |key, value| values << "#{key}=#{value.to_s.inspect}" end "#{type} #{values * comma}" end
Public
# File lib/faraday/request/authorization.rb, line 6 def self.header(type, token) case token when String, Symbol "#{type} #{token}" when Hash build_hash(type.to_s, token) else raise ArgumentError, "Can't build an Authorization #{type} header from #{token.inspect}" end end
Generated with the Darkfish Rdoc Generator 2.