Class: Primate::URL
- Inherits:
-
Object
- Object
- Primate::URL
- Defined in:
- lib/primate/url.rb
Instance Attribute Summary collapse
-
#hash ⇒ Object
readonly
Returns the value of attribute hash.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#hostname ⇒ Object
readonly
Returns the value of attribute hostname.
-
#href ⇒ Object
readonly
Returns the value of attribute href.
-
#origin ⇒ Object
readonly
Returns the value of attribute origin.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#pathname ⇒ Object
readonly
Returns the value of attribute pathname.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#protocol ⇒ Object
readonly
Returns the value of attribute protocol.
-
#search ⇒ Object
readonly
Returns the value of attribute search.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(url) ⇒ URL
constructor
initialize URL from JavaScript URL object.
Constructor Details
#initialize(url) ⇒ URL
initialize URL from JavaScript URL object
10 11 12 13 14 15 16 17 18 19 20 21 22 |
# File 'lib/primate/url.rb', line 10 def initialize(url) @href = url['href'].to_s @origin = url['origin'].to_s @protocol = url['protocol'].to_s @username = url['username'].to_s @password = url['password'].to_s @host = url['host'].to_s @hostname = url['hostname'].to_s @port = url['port'].to_s @pathname = url['pathname'].to_s @search = url['search'].to_s @hash = url['hash'].to_s end |
Instance Attribute Details
#hash ⇒ Object (readonly)
Returns the value of attribute hash.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def hash @hash end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def host @host end |
#hostname ⇒ Object (readonly)
Returns the value of attribute hostname.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def hostname @hostname end |
#href ⇒ Object (readonly)
Returns the value of attribute href.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def href @href end |
#origin ⇒ Object (readonly)
Returns the value of attribute origin.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def origin @origin end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def password @password end |
#pathname ⇒ Object (readonly)
Returns the value of attribute pathname.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def pathname @pathname end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def port @port end |
#protocol ⇒ Object (readonly)
Returns the value of attribute protocol.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def protocol @protocol end |
#search ⇒ Object (readonly)
Returns the value of attribute search.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def search @search end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
5 6 7 |
# File 'lib/primate/url.rb', line 5 def username @username end |