StringScanner
A pattern that matches the comma in a (typically date) value.
A pattern that matches a cookie name or attribute name which may be empty, capturing trailing whitespace.
Whitespace.
# File lib/http/cookie/scanner.rb, line 34 def scan_dquoted ''.tap { |s| case when skip(/"/) break when skip(/\\/) s << getch when scan(/[^"\\]+/) s << matched end until eos? } end
# File lib/http/cookie/scanner.rb, line 47 def scan_name scan(RE_NAME).tap { |s| s.rstrip! if s } end
# File lib/http/cookie/scanner.rb, line 71 def scan_name_value name = scan_name if skip(/\=/) value = scan_value else scan_value value = nil end [name, value] end
# File lib/http/cookie/scanner.rb, line 53 def scan_value ''.tap { |s| case when scan(/[^,;"]+/) s << matched when skip(/"/) # RFC 6265 2.2 # A cookie-value may be DQUOTE'd. s << scan_dquoted when check(/;|#{RE_COOKIE_COMMA}/) break else s << getch end until eos? s.rstrip! } end
Generated with the Darkfish Rdoc Generator 2.