Class: URI::Generic
- Inherits:
-
Object
- Object
- URI::Generic
- Defined in:
- lib/opal_patches.rb
Overview
Opal’s stdlib does not implement URI.parse. Rack::Protection calls ‘URI.parse(env).host`. A tiny JS-URL-backed parser is enough to cover that and any equivalent `host`-only usage.
Instance Attribute Summary collapse
-
#fragment ⇒ Object
readonly
Returns the value of attribute fragment.
-
#host ⇒ Object
readonly
Returns the value of attribute host.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#port ⇒ Object
readonly
Returns the value of attribute port.
-
#query ⇒ Object
readonly
Returns the value of attribute query.
-
#scheme ⇒ Object
readonly
Returns the value of attribute scheme.
Instance Method Summary collapse
-
#initialize(host:, scheme:, port:, path:, query:, fragment:) ⇒ Generic
constructor
A new instance of Generic.
Constructor Details
#initialize(host:, scheme:, port:, path:, query:, fragment:) ⇒ Generic
Returns a new instance of Generic.
301 302 303 304 305 306 307 308 |
# File 'lib/opal_patches.rb', line 301 def initialize(host:, scheme:, port:, path:, query:, fragment:) @host = host @scheme = scheme @port = port @path = path @query = query @fragment = fragment end |
Instance Attribute Details
#fragment ⇒ Object (readonly)
Returns the value of attribute fragment.
299 300 301 |
# File 'lib/opal_patches.rb', line 299 def fragment @fragment end |
#host ⇒ Object (readonly)
Returns the value of attribute host.
299 300 301 |
# File 'lib/opal_patches.rb', line 299 def host @host end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
299 300 301 |
# File 'lib/opal_patches.rb', line 299 def path @path end |
#port ⇒ Object (readonly)
Returns the value of attribute port.
299 300 301 |
# File 'lib/opal_patches.rb', line 299 def port @port end |
#query ⇒ Object (readonly)
Returns the value of attribute query.
299 300 301 |
# File 'lib/opal_patches.rb', line 299 def query @query end |
#scheme ⇒ Object (readonly)
Returns the value of attribute scheme.
299 300 301 |
# File 'lib/opal_patches.rb', line 299 def scheme @scheme end |