Class: URI::HTTP
- Inherits:
-
Object
- Object
- URI::HTTP
- Defined in:
- lib/hub/speedy_stdlib.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#fragment ⇒ Object
Returns the value of attribute fragment.
-
#host ⇒ Object
(also: #hostname)
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#path ⇒ Object
Returns the value of attribute path.
-
#port ⇒ Object
Returns the value of attribute port.
-
#query ⇒ Object
Returns the value of attribute query.
-
#scheme ⇒ Object
Returns the value of attribute scheme.
-
#user ⇒ Object
Returns the value of attribute user.
Instance Method Summary collapse
- #find_proxy ⇒ Object
-
#initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, *extra) ⇒ HTTP
constructor
A new instance of HTTP.
- #request_uri ⇒ Object
- #to_s ⇒ Object
- #userinfo ⇒ Object
- #userinfo=(info) ⇒ Object
Constructor Details
#initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, *extra) ⇒ HTTP
Returns a new instance of HTTP.
76 77 78 79 80 81 82 83 84 |
# File 'lib/hub/speedy_stdlib.rb', line 76 def initialize(scheme, userinfo, host, port, registry, path, opaque, query, fragment, *extra) self.scheme = scheme self.userinfo = userinfo self.host = host self.port = port self.path = path self.query = query self.fragment = fragment end |
Instance Attribute Details
#fragment ⇒ Object
Returns the value of attribute fragment.
72 73 74 |
# File 'lib/hub/speedy_stdlib.rb', line 72 def fragment @fragment end |
#host ⇒ Object Also known as: hostname
Returns the value of attribute host.
72 73 74 |
# File 'lib/hub/speedy_stdlib.rb', line 72 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
72 73 74 |
# File 'lib/hub/speedy_stdlib.rb', line 72 def password @password end |
#path ⇒ Object
Returns the value of attribute path.
72 73 74 |
# File 'lib/hub/speedy_stdlib.rb', line 72 def path @path end |
#port ⇒ Object
Returns the value of attribute port.
73 74 75 |
# File 'lib/hub/speedy_stdlib.rb', line 73 def port @port end |
#query ⇒ Object
Returns the value of attribute query.
72 73 74 |
# File 'lib/hub/speedy_stdlib.rb', line 72 def query @query end |
#scheme ⇒ Object
Returns the value of attribute scheme.
72 73 74 |
# File 'lib/hub/speedy_stdlib.rb', line 72 def scheme @scheme end |
#user ⇒ Object
Returns the value of attribute user.
72 73 74 |
# File 'lib/hub/speedy_stdlib.rb', line 72 def user @user end |
Instance Method Details
#find_proxy ⇒ Object
121 122 |
# File 'lib/hub/speedy_stdlib.rb', line 121 def find_proxy end |
#request_uri ⇒ Object
96 97 98 99 100 |
# File 'lib/hub/speedy_stdlib.rb', line 96 def request_uri url = path url += "?#{query}" if query url end |
#to_s ⇒ Object
86 87 88 89 90 91 92 93 94 |
# File 'lib/hub/speedy_stdlib.rb', line 86 def to_s url = "#{scheme}://" url << "#{userinfo}@" if user || password url << host << display_port url << path url << "?#{query}" if query url << "##{fragment}" if fragment url end |
#userinfo ⇒ Object
115 116 117 118 119 |
# File 'lib/hub/speedy_stdlib.rb', line 115 def userinfo if password then "#{user}:#{password}" elsif user then user end end |
#userinfo=(info) ⇒ Object
110 111 112 113 |
# File 'lib/hub/speedy_stdlib.rb', line 110 def userinfo=(info) self.user, self.password = info.to_s.split(':', 2) info end |