Class: OpenID::SReg::Request

Class | OpenID::SReg::Request
In: | lib/openid/extensions/sreg.rb
Parent: | Extension

An object to hold the state of a simple registration request.

### Methods

all_requested_fields from_openid_request get_extension_args member? new parse_extension_args request_field request_fields were_fields_requested?

### Attributes

ns_uri | [R] |
optional | [R] |
policy_url | [RW] |
required | [R] |

### Public Class methods

from_openid_request(request)

Create a simple registration request that contains the fields that were requested in the OpenID request with the given arguments Takes an OpenID::CheckIDRequest, returns an OpenID::Sreg::Request return nil if the extension was not requested.

new(required = nil, optional = nil, policy_url = nil, ns_uri = NS_URI)

### Public Instance methods

all_requested_fields()

A list of all of the simple registration fields that were requested, whether they were required or optional.

get_extension_args()

Get a hash of unqualified simple registration arguments representing this request. This method is essentially the inverse of parse_extension_args. This method serializes the simple registration request fields.

member?(field_name)
parse_extension_args(args, strict = false)

Parse the unqualified simple registration request parameters and add them to this object.

This method is essentially the inverse of getExtensionArgs. This method restores the serialized simple registration request fields.

If you are extracting arguments from a standard OpenID checkid_* request, you probably want to use fromOpenIDRequest, which will extract the sreg namespace and arguments from the OpenID request. This method is intended for cases where the OpenID server needs more control over how the arguments are parsed than that method provides.

request_field(field_name, required=false, strict=false)

Request the specified field from the OpenID user field_name: the unqualified simple registration field name required: whether the given field should be presented

           to the user as being a required to successfully complete
           the request

strict: whether to raise an exception when a field is

           added to a request more than once

Raises ArgumentError if the field_name is not a simple registration field, or if strict is set and a field is added more than once

request_fields(field_names, required = false, strict = false)

Add the given list of fields to the request.

were_fields_requested?()

Have any simple registration fields been requested?

[Validate]