static public Method

MailTo.new(*arg)

Description

Creates a new URI::MailTo object from generic URL components with no syntax checking.

This method is usually called from URI::parse, which checks the validity of each component.

Source Code

# File uri/mailto.rb, line 131
def initialize(*arg)
  super(*arg)

  @to = nil
  @headers = []

  if MAILTO_REGEXP =~ @opaque
     if arg[-1]
      self.to = $1
      self.headers = $2
    else
      set_to($1)
      set_headers($2)
    end

  else
    raise InvalidComponentError,
      "unrecognised opaque part for mailtoURL: #{@opaque}"
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.