Class: Dommy::Internal::UrlParser::Record

Inherits:
Struct
  • Object
show all
Defined in:
lib/dommy/internal/url_parser.rb

Overview

The spec URL record. ‘path` is an Array of segments for a hierarchical URL, or a String for an “opaque path” (cannot-be-a-base) URL. `host` is the already-serialized host string (IPv6 stored with brackets), or nil.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fragmentObject

Returns the value of attribute fragment

Returns:

  • (Object)

    the current value of fragment



24
25
26
# File 'lib/dommy/internal/url_parser.rb', line 24

def fragment
  @fragment
end

#hostObject

Returns the value of attribute host

Returns:

  • (Object)

    the current value of host



24
25
26
# File 'lib/dommy/internal/url_parser.rb', line 24

def host
  @host
end

#passwordObject

Returns the value of attribute password

Returns:

  • (Object)

    the current value of password



24
25
26
# File 'lib/dommy/internal/url_parser.rb', line 24

def password
  @password
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



24
25
26
# File 'lib/dommy/internal/url_parser.rb', line 24

def path
  @path
end

#portObject

Returns the value of attribute port

Returns:

  • (Object)

    the current value of port



24
25
26
# File 'lib/dommy/internal/url_parser.rb', line 24

def port
  @port
end

#queryObject

Returns the value of attribute query

Returns:

  • (Object)

    the current value of query



24
25
26
# File 'lib/dommy/internal/url_parser.rb', line 24

def query
  @query
end

#schemeObject

Returns the value of attribute scheme

Returns:

  • (Object)

    the current value of scheme



24
25
26
# File 'lib/dommy/internal/url_parser.rb', line 24

def scheme
  @scheme
end

#usernameObject

Returns the value of attribute username

Returns:

  • (Object)

    the current value of username



24
25
26
# File 'lib/dommy/internal/url_parser.rb', line 24

def username
  @username
end

Instance Method Details

#default_portObject



28
# File 'lib/dommy/internal/url_parser.rb', line 28

def default_port = SPECIAL[scheme]

#includes_credentials?Boolean

Returns:

  • (Boolean)


27
# File 'lib/dommy/internal/url_parser.rb', line 27

def includes_credentials? = !username.to_s.empty? || !password.to_s.empty?

#opaque_path?Boolean

Returns:

  • (Boolean)


26
# File 'lib/dommy/internal/url_parser.rb', line 26

def opaque_path? = path.is_a?(String)

#special?Boolean

Returns:

  • (Boolean)


25
# File 'lib/dommy/internal/url_parser.rb', line 25

def special? = SPECIAL.key?(scheme)