Class: HyperRouter::Location
- Inherits:
-
Object
- Object
- HyperRouter::Location
- Includes:
- Native
- Defined in:
- lib/hyper-router/location.rb
Instance Method Summary collapse
-
#initialize(native) ⇒ Location
constructor
A new instance of Location.
- #query ⇒ Object
- #to_n ⇒ Object
Constructor Details
#initialize(native) ⇒ Location
Returns a new instance of Location.
5 6 7 |
# File 'lib/hyper-router/location.rb', line 5 def initialize(native) @native = native end |
Instance Method Details
#query ⇒ Object
13 14 15 16 17 18 19 20 21 |
# File 'lib/hyper-router/location.rb', line 13 def query return {} if search.blank? Hash[search[1..-1].split('&').map { |part| name, value = part.split('=') [`decodeURIComponent(#{name})`, `decodeURIComponent(#{value})`] }] end |
#to_n ⇒ Object
9 10 11 |
# File 'lib/hyper-router/location.rb', line 9 def to_n @native end |