Class: Browser::Location
- Includes:
- Native
- Defined in:
- opal/browser/location.rb
Overview
Allows manipulation of a location, usually from Window and DOM::Document.
Instance Attribute Summary collapse
-
#fragment ⇒ String
The hash fragment of the location URI.
-
#host ⇒ String
The host part of the location URI.
-
#path ⇒ String
The path part of the location URI.
-
#port ⇒ Integer
The port part of the location URI.
-
#query ⇒ String
The query part of the location URI.
-
#scheme ⇒ String
The scheme part of the location URI.
-
#uri ⇒ String
The whole location URI.
Instance Method Summary collapse
-
#assign(url) ⇒ Object
Change the location.
-
#reload(force = false) ⇒ Object
Reload the page.
-
#replace(url) ⇒ Object
Replace the current URL.
-
#to_s ⇒ Object
Convert the location to a string.
Instance Attribute Details
#fragment ⇒ String
Returns the hash fragment of the location URI.
37 |
# File 'opal/browser/location.rb', line 37 alias_native :fragment, :hash |
#host ⇒ String
Returns the host part of the location URI.
42 |
# File 'opal/browser/location.rb', line 42 alias_native :host |
#path ⇒ String
Returns the path part of the location URI.
52 |
# File 'opal/browser/location.rb', line 52 alias_native :path, :pathname |
#port ⇒ Integer
Returns the port part of the location URI.
57 |
# File 'opal/browser/location.rb', line 57 alias_native :port |
#query ⇒ String
Returns the query part of the location URI.
67 |
# File 'opal/browser/location.rb', line 67 alias_native :query, :search |
#scheme ⇒ String
Returns the scheme part of the location URI.
62 |
# File 'opal/browser/location.rb', line 62 alias_native :scheme, :protocol |
#uri ⇒ String
Returns the whole location URI.
47 |
# File 'opal/browser/location.rb', line 47 alias_native :uri, :href |
Instance Method Details
#assign(url) ⇒ Object
Change the location.
12 13 14 |
# File 'opal/browser/location.rb', line 12 def assign(url) `#@native.assign(#{url.to_s})` end |
#reload(force = false) ⇒ Object
Reload the page.
26 27 28 |
# File 'opal/browser/location.rb', line 26 def reload(force = false) `#@native.reload(force)` end |
#replace(url) ⇒ Object
Replace the current URL.
19 20 21 |
# File 'opal/browser/location.rb', line 19 def replace(url) `#@native.replace(#{url.to_s})` end |
#to_s ⇒ Object
Convert the location to a string.
31 32 33 |
# File 'opal/browser/location.rb', line 31 def to_s `#@native.toString()` end |