123456789_123456789_123456789_123456789_123456789_

Class: Rack::Auth::Basic::Request

Relationships & Source Files
Super Chains via Extension / Inclusion / Inheritance
Class Chain:
Instance Chain:
Inherits: Rack::Auth::AbstractRequest
Defined in: lib/rack/auth/basic.rb

Constant Summary

Auth::AbstractRequest - Inherited

AUTHORIZATION_KEYS

Class Method Summary

Instance Attribute Summary

Instance Method Summary

Constructor Details

This class inherits a constructor from Rack::Auth::AbstractRequest

Instance Attribute Details

#basic?Boolean (readonly)

[ GitHub ]

  
# File 'lib/rack/auth/basic.rb', line 43

def basic?
  "basic" == scheme && credentials.length == 2
end

Instance Method Details

#credentials

[ GitHub ]

  
# File 'lib/rack/auth/basic.rb', line 47

def credentials
  @credentials ||= params.unpack1('m').split(':', 2)
end

#username

[ GitHub ]

  
# File 'lib/rack/auth/basic.rb', line 51

def username
  credentials.first
end