HTTP::AuthorizationHeader

Authorization header value builders

Public Class Methods

build(type, opts) click to toggle source

Builds Authorization header value with associated builder. @param [to_sym] type @param [Object] opts @return [String]

# File lib/http/authorization_header.rb, line 17
def build(type, opts)
  klass = builders[type.to_sym]

  fail Error, "Unknown authorization type #{type}" unless klass

  klass.new opts
end
register(type, klass) click to toggle source

Associate type with given builder. @param [to_sym] type @param [Class] klass @return [void]

# File lib/http/authorization_header.rb, line 9
def register(type, klass)
  builders[type.to_sym] = klass
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.