Class: Browser::Location

Inherits:
Object show all
Includes:
Native
Defined in:
lib/wedge/plugins/location.rb

Overview

Allows manipulation of a location, usually from Window and DOM::Document.

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#fragmentString



37
# File 'lib/wedge/plugins/location.rb', line 37

alias_native :fragment, :hash

#hostString



42
# File 'lib/wedge/plugins/location.rb', line 42

alias_native :host

#pathString



52
# File 'lib/wedge/plugins/location.rb', line 52

alias_native :path, :pathname

#portInteger



57
# File 'lib/wedge/plugins/location.rb', line 57

alias_native :port

#queryString



67
# File 'lib/wedge/plugins/location.rb', line 67

alias_native :query, :search

#schemeString



62
# File 'lib/wedge/plugins/location.rb', line 62

alias_native :scheme, :protocol

#uriString



47
# File 'lib/wedge/plugins/location.rb', line 47

alias_native :uri, :href

Instance Method Details

#assign(url) ⇒ Object

Change the location.



12
13
14
# File 'lib/wedge/plugins/location.rb', line 12

def assign(url)
  `#@native.assign(#{url.to_s})`
end

#reload(force = false) ⇒ Object

Reload the page.



26
27
28
# File 'lib/wedge/plugins/location.rb', line 26

def reload(force = false)
  `#@native.reload(force)`
end

#replace(url) ⇒ Object

Replace the current URL.



19
20
21
# File 'lib/wedge/plugins/location.rb', line 19

def replace(url)
  `#@native.replace(#{url.to_s})`
end

#to_sObject

Convert the location to a string.



31
32
33
# File 'lib/wedge/plugins/location.rb', line 31

def to_s
  `#@native.toString()`
end