Module: WebPipe::Url

Included in:
Conn
Defined in:
lib/web_pipe/extensions/url/url.rb

Overview

See the docs for the extension linked from the README.

Instance Method Summary collapse

Instance Method Details

#base_urlString

Base part of the URL.

This is #scheme and #host, adding #port unless it is the default one for the scheme.

Examples:

'https://example.org'
'http://example.org:8000'

Returns:

  • (String)


17
18
19
# File 'lib/web_pipe/extensions/url/url.rb', line 17

def base_url
  request.base_url
end

#full_pathString

URL full path.

This is #path with #query_string if present.

Examples:

'/users?id=1'

Returns:

  • (String)


41
42
43
# File 'lib/web_pipe/extensions/url/url.rb', line 41

def full_path
  request.fullpath
end

#pathString

URL path.

This is #script_name and #path_info.

Examples:

'index.rb/users'

Returns:

  • (String)


29
30
31
# File 'lib/web_pipe/extensions/url/url.rb', line 29

def path
  request.path
end

#urlString

Request URL.

This is the same as #base_url plus #full_path.

Examples:

'http://www.example.org:8000/users?id=1'

Returns:

  • (String)


53
54
55
# File 'lib/web_pipe/extensions/url/url.rb', line 53

def url
  request.url
end