class Restfulness::Requests::AuthorizationHeader

Handle the HTTP Authorization header payload to automatically extract the scheme and parameters.

Attributes

params[RW]
schema[RW]

Public Class Methods

new(payload) click to toggle source
# File lib/restfulness/requests/authorization_header.rb, line 10
def initialize(payload)
  (self.schema, self.params) = payload.strip.split(' ', 2)
end

Public Instance Methods

schema=(txt) click to toggle source
# File lib/restfulness/requests/authorization_header.rb, line 14
def schema=(txt)
  # Make sure we're in Titlecase
  @schema = txt.slice(0,1).capitalize + txt.slice(1..-1).downcase
end