Class: RWB::UrlSession
Instance Attribute Summary
Attributes inherited from Url
Instance Method Summary collapse
-
#initialize(weight, session, name, method = 'GET') ⇒ UrlSession
constructor
A new instance of UrlSession.
- #to_base ⇒ Object
- #to_s ⇒ Object
- #to_url ⇒ Object
Methods inherited from Url
Constructor Details
#initialize(weight, session, name, method = 'GET') ⇒ UrlSession
Returns a new instance of UrlSession.
100 101 102 103 104 105 106 |
# File 'lib/rwb/url.rb', line 100 def initialize(weight, session, name, method='GET') @weight = weight @session = session @urls = [] @name = name @method = read_method(method) end |
Instance Method Details
#to_base ⇒ Object
116 117 118 |
# File 'lib/rwb/url.rb', line 116 def to_base @name end |
#to_s ⇒ Object
120 121 122 |
# File 'lib/rwb/url.rb', line 120 def to_s @weight.to_s + " " + @name end |
#to_url ⇒ Object
108 109 110 111 112 113 114 |
# File 'lib/rwb/url.rb', line 108 def to_url if @urls == [] @urls << @session @urls.flatten! end @urls.shift end |