Sha256: 431813bbd1f2dfb5ee069f8d4132cf925756c023d72808c2ce0895fc3d4dcbda

Contents?: true

Size: 486 Bytes

Versions: 6

Compression:

Stored size: 486 Bytes

Contents

module Restfulness
  module Requests

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

      attr_accessor :schema, :params

      def initialize(payload)
        (self.schema, self.params) = payload.strip.split(' ', 2)
      end

      def schema=(txt)
        # Make sure we're in Titlecase
        @schema = txt.slice(0,1).capitalize + txt.slice(1..-1).downcase
      end

    end

  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
restfulness-0.3.6 lib/restfulness/requests/authorization_header.rb
restfulness-0.3.5 lib/restfulness/requests/authorization_header.rb
restfulness-0.3.4 lib/restfulness/requests/authorization_header.rb
restfulness-0.3.3 lib/restfulness/requests/authorization_header.rb
restfulness-0.3.2 lib/restfulness/requests/authorization_header.rb
restfulness-0.3.1 lib/restfulness/requests/authorization_header.rb