Class: Trample::Session
- Inherits:
-
Object
- Object
- Trample::Session
- Defined in:
- lib/trample/session.rb
Instance Attribute Summary collapse
-
#config ⇒ Object
readonly
Returns the value of attribute config.
-
#cookies ⇒ Object
readonly
Returns the value of attribute cookies.
-
#last_response ⇒ Object
readonly
Returns the value of attribute last_response.
-
#response_times ⇒ Object
readonly
Returns the value of attribute response_times.
Instance Method Summary collapse
-
#initialize(config) ⇒ Session
constructor
A new instance of Session.
- #trample ⇒ Object
Methods included from Timer
Methods included from Logging
Constructor Details
#initialize(config) ⇒ Session
Returns a new instance of Session.
8 9 10 11 12 |
# File 'lib/trample/session.rb', line 8 def initialize(config) @config = config @response_times = [] @cookies = {} end |
Instance Attribute Details
#config ⇒ Object (readonly)
Returns the value of attribute config.
6 7 8 |
# File 'lib/trample/session.rb', line 6 def config @config end |
#cookies ⇒ Object (readonly)
Returns the value of attribute cookies.
6 7 8 |
# File 'lib/trample/session.rb', line 6 def @cookies end |
#last_response ⇒ Object (readonly)
Returns the value of attribute last_response.
6 7 8 |
# File 'lib/trample/session.rb', line 6 def last_response @last_response end |
#response_times ⇒ Object (readonly)
Returns the value of attribute response_times.
6 7 8 |
# File 'lib/trample/session.rb', line 6 def response_times @response_times end |
Instance Method Details
#trample ⇒ Object
14 15 16 17 18 19 20 21 22 |
# File 'lib/trample/session.rb', line 14 def trample hit @config.login unless @config.login.nil? @config.iterations.times do @config.pages.each do |p| hit p end end sleep @config.sleep unless @config.sleep.nil? end |