Class: Xtctimer::Timer
- Inherits:
-
Object
- Object
- Xtctimer::Timer
- Defined in:
- lib/xtctimer.rb
Constant Summary collapse
- BASE_URL =
"http://xtc-timings.azurewebsites.net/"
Instance Attribute Summary collapse
-
#device ⇒ Object
readonly
Returns the value of attribute device.
-
#guid ⇒ Object
readonly
Returns the value of attribute guid.
-
#isAndroid ⇒ Object
readonly
Returns the value of attribute isAndroid.
-
#isTestCloud ⇒ Object
readonly
Returns the value of attribute isTestCloud.
-
#runTime ⇒ Object
readonly
Returns the value of attribute runTime.
-
#scenario ⇒ Object
readonly
Returns the value of attribute scenario.
-
#startTime ⇒ Object
readonly
Returns the value of attribute startTime.
Instance Method Summary collapse
- #finish ⇒ Object
-
#initialize(guid, scenario, isTestCloud, isAndroid, device = "Local device") ⇒ Timer
constructor
A new instance of Timer.
- #start ⇒ Object
Constructor Details
#initialize(guid, scenario, isTestCloud, isAndroid, device = "Local device") ⇒ Timer
Returns a new instance of Timer.
21 22 23 24 25 26 27 28 29 |
# File 'lib/xtctimer.rb', line 21 def initialize(guid, scenario, isTestCloud, isAndroid, device = "Local device") @guid = guid @scenario = scenario @isTestCloud = isTestCloud @isAndroid = isAndroid @device = device @runTime = nil end |
Instance Attribute Details
#device ⇒ Object (readonly)
Returns the value of attribute device.
17 18 19 |
# File 'lib/xtctimer.rb', line 17 def device @device end |
#guid ⇒ Object (readonly)
Returns the value of attribute guid.
13 14 15 |
# File 'lib/xtctimer.rb', line 13 def guid @guid end |
#isAndroid ⇒ Object (readonly)
Returns the value of attribute isAndroid.
16 17 18 |
# File 'lib/xtctimer.rb', line 16 def isAndroid @isAndroid end |
#isTestCloud ⇒ Object (readonly)
Returns the value of attribute isTestCloud.
15 16 17 |
# File 'lib/xtctimer.rb', line 15 def isTestCloud @isTestCloud end |
#runTime ⇒ Object (readonly)
Returns the value of attribute runTime.
18 19 20 |
# File 'lib/xtctimer.rb', line 18 def runTime @runTime end |
#scenario ⇒ Object (readonly)
Returns the value of attribute scenario.
14 15 16 |
# File 'lib/xtctimer.rb', line 14 def scenario @scenario end |
#startTime ⇒ Object (readonly)
Returns the value of attribute startTime.
19 20 21 |
# File 'lib/xtctimer.rb', line 19 def startTime @startTime end |
Instance Method Details
#finish ⇒ Object
35 36 37 38 39 40 |
# File 'lib/xtctimer.rb', line 35 def finish() endTime = Time.now @runTime = endTime - startTime post(self) puts "Ended timer. Elapsed: #{@runTime}" end |
#start ⇒ Object
31 32 33 |
# File 'lib/xtctimer.rb', line 31 def start() @startTime = Time.now end |