class

LinkHeader

Inherits Reference < Object

Constants

ATTR = /#{TOKEN} *= *(#{TOKEN}|#{QUOTED}) */
COMMA = /, */
HREF = /\ *< *([^>]*) *> *;? */

Regexes for link header parsing. TOKEN and QUOTED in particular should conform to RFC2616.

Acknowledgement: The QUOTED regexp is based on http://stackoverflow.com/questions/249791/regexp-for-quoted-string-with-escaping-quotes/249937#249937

QUOTED = /"((?:[^"\\]|\\.)*)"/
SEMI = /; */
TOKEN = /([^()<>@,;:\"\[\]?={}\s]+)/

Constructors

new(headers : HTTP::Headers)
Source

Class methods

Instance methods

[](key : String) : String

shortcut for looking up links matching rel

Source
[]?(key : String) : String | Nil
Source
fetch(key : String, &)
Source
fetch(key : String, default)
Source
get(key : String)
Source
to_s(io : IO) : Nil

Appends a short String representation of this object which includes its class name and its object address.

class Person
  def initialize(@name : String, @age : Int32)
  end
end

Person.new("John", 32).to_s # => #<Person:0x10a199f20>
Source