Class: OpenID::Request

### Home Classes Methods

### In Files

- lib/openid/interface.rb

### Parent

Object

### Methods

- ::new
- #[]
- #get

### Class/Module Index

Quicksearch

- OpenID
- OpenID::Association
- OpenID::AssociationManager
- OpenID::AuthenticationError
- OpenID::BaseAssociationManager
- OpenID::Consumer
- OpenID::ConsumerAssociation
- OpenID::DiffieHelmanAssociator
- OpenID::DumbAssociationManager
- OpenID::NoArgumentsError
- OpenID::NoOpenIDArgs
- OpenID::ProtocolError
- OpenID::Request
- OpenID::Response
- OpenID::ServerAssociation
- OpenID::SimpleHTTPClient
- OpenID::UserCancelled
- OpenID::UserSetupNeeded
- OpenID::ValueMismatchError
- String
- String::OpenID
- Bignum
- Crypto_math
- DateTime
- Fixnum

No matching classes.

# OpenID::Request

Request objects are used by both the consumer and server APIs to signal and represent various HTTP requests.

### Attributes

args[RW]
authentication[R]
http_method[RW]

### Public Class Methods

new(args, http_method, authentication=nil) click to toggle source

args is a hash of HTTP arguments. http_method should be set to "POST" or "GET" authentication is an unused passthrough field that will remain attatched to the request. A NoOpenIDArgs exception will be raised if args contains no openid.* arguments.

    # File lib/openid/interface.rb, line 36
    def initialize(args, http_method, authentication=nil)
            @args = args
            @http_method = http_method.upcase
            @authentication = authentication

            @args.each_key { |key|
                    return if key.index('openid.') == 0
            }
            raise NoOpenIDArgs
    end

### Public Instance Methods

[](key) click to toggle source

The preferred method for getting OpenID args out of the request. Raises a ProtoclError if the argument does not exist.

    # File lib/openid/interface.rb, line 48
    def [](key)
            result = get(key)
            if result == nil
                    if key == 'trust_root'
                            return self['return_to']
                    else
                            raise ProtocolError, "Query argument #{key} not found", caller
                    end
            end
            return result
    end

get(key, default=nil) click to toggle source

    # File lib/openid/interface.rb, line 60
    def get(key, default=nil)
            return @args.fetch('openid.' + key, default)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.