summaryrefslogtreecommitdiff
path: root/lib/uri/mailto.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/uri/mailto.rb')
-rw-r--r--lib/uri/mailto.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/lib/uri/mailto.rb b/lib/uri/mailto.rb
index 3edaac93f3..1e8f2da063 100644
--- a/lib/uri/mailto.rb
+++ b/lib/uri/mailto.rb
@@ -16,8 +16,10 @@ module URI
class MailTo < Generic
include REGEXP
+ # A Default port of nil for URI::MailTo
DEFAULT_PORT = nil
+ # An Array of the available components for URI::MailTo
COMPONENT = [ :scheme, :to, :headers ].freeze
# :stopdoc:
@@ -155,6 +157,9 @@ module URI
# E-mail headers set by the URL, as an Array of Arrays
attr_reader :headers
+ # check the to +v+ component against either
+ # * URI::Parser Regexp for :OPAQUE
+ # * MAILBOX_PATTERN
def check_to(v)
return true unless v
return true if v.size == 0
@@ -168,17 +173,22 @@ module URI
end
private :check_to
+ # private setter for to +v+
def set_to(v)
@to = v
end
protected :set_to
+ # setter for to +v+
def to=(v)
check_to(v)
set_to(v)
v
end
+ # check the headers +v+ component against either
+ # * URI::Parser Regexp for :OPAQUE
+ # * HEADER_PATTERN
def check_headers(v)
return true unless v
return true if v.size == 0
@@ -193,6 +203,7 @@ module URI
end
private :check_headers
+ # private setter for headers +v+
def set_headers(v)
@headers = []
if v
@@ -203,12 +214,14 @@ module URI
end
protected :set_headers
+ # setter for headers +v+
def headers=(v)
check_headers(v)
set_headers(v)
v
end
+ # Constructs String from URI
def to_s
@scheme + ':' +
if @to