class URI::Tag
Constants
- AUTHORITY_PATTERN
- COMPONENT
- DATE_PATTERN
- DNSCOMP_PATTERN
- DNSNAME_PATTERN
- PCHAR_PATTERN
- SPECIFIC_PATTERN
- SUB_DELIMS_PATTERN
- TAG_REGEXP
- UNRESERVED_PATTERN
Attributes
date[R]
fragment[R]
specific[R]
Public Class Methods
build(args)
click to toggle source
Calls superclass method
# File lib/uri/tag.rb, line 25 def self.build(args) tmp = Util.make_components_hash(self, args) tmp[:opaque] = "%{authority},%{date}:%{specific}" % tmp return super(tmp) end
new(*arg)
click to toggle source
Calls superclass method
# File lib/uri/tag.rb, line 34 def initialize(*arg) super(*arg) self.opaque = @opaque end
Public Instance Methods
date=(value)
click to toggle source
# File lib/uri/tag.rb, line 50 def date=(value) check_date(value) set_date(value) value end
date_to_time()
click to toggle source
opaque=(value)
click to toggle source
# File lib/uri/tag.rb, line 62 def opaque=(value) check_opaque(value) if TAG_REGEXP =~ value self.authority = $~['authority'] self.date = $~['date'] self.specific = $~['specific'] else raise InvalidURIError, "bad URI(authority nor date not set?): #{self}" # raise InvalidURIError rather than InvalidComponentError, just because URI::Generic#check_opaque does so end set_opaque(value) value end
specific=(value)
click to toggle source
# File lib/uri/tag.rb, line 56 def specific=(value) check_specific(value) set_specific(value) value end
tagging_entity()
click to toggle source
# File lib/uri/tag.rb, line 40 def tagging_entity authority + ',' + date end
Protected Instance Methods
set_date(date)
click to toggle source
# File lib/uri/tag.rb, line 100 def set_date(date) @date = date end
set_specific(specific)
click to toggle source
# File lib/uri/tag.rb, line 104 def set_specific(specific) @specific = specific end
Private Instance Methods
check_date(value)
click to toggle source
# File lib/uri/tag.rb, line 118 def check_date(value) if value !~ /\A(?:#{DATE_PATTERN}\z)/o raise InvalidComponentError, "bad component(expected date component: #{value})" end return true end
check_specific(value)
click to toggle source
# File lib/uri/tag.rb, line 126 def check_specific(value) if value !~ /\A#{SPECIFIC_PATTERN}\z/o raise InvalidComponentError, "bad component(expected specific component: #{value})" end return true end