Class: Geppeto::Commands::Uptime
- Inherits:
-
Object
- Object
- Geppeto::Commands::Uptime
- Defined in:
- lib/commands/uptime.rb
Instance Method Summary collapse
- #awake ⇒ Object
- #getlastreset ⇒ Object
-
#initialize(scout) ⇒ Uptime
constructor
A new instance of Uptime.
- #micros ⇒ Object
- #report ⇒ Object
- #seconds ⇒ Object
- #sleeping ⇒ Object
- #status ⇒ Object
Constructor Details
#initialize(scout) ⇒ Uptime
Returns a new instance of Uptime.
5 6 7 8 |
# File 'lib/commands/uptime.rb', line 5 def initialize(scout) @context = nil @scout = scout end |
Instance Method Details
#awake ⇒ Object
36 37 38 39 |
# File 'lib/commands/uptime.rb', line 36 def awake @context = :awake self end |
#getlastreset ⇒ Object
28 29 30 |
# File 'lib/commands/uptime.rb', line 28 def getlastreset @scout.request("uptime.getlastreset") end |
#micros ⇒ Object
10 11 12 13 14 15 |
# File 'lib/commands/uptime.rb', line 10 def micros context ||= ".#{@context}" unless @context.nil? command = "uptime#{context}.micros" @scout.request(command) @context = nil end |
#report ⇒ Object
24 25 26 |
# File 'lib/commands/uptime.rb', line 24 def report @scout.request("uptime.report") end |
#seconds ⇒ Object
17 18 19 20 21 22 |
# File 'lib/commands/uptime.rb', line 17 def seconds context ||= ".#{@context}" unless @context.nil? command = "uptime#{context}.seconds" @scout.request(command) @context = nil end |
#sleeping ⇒ Object
41 42 43 44 |
# File 'lib/commands/uptime.rb', line 41 def sleeping @context = :sleeping self end |
#status ⇒ Object
32 33 34 |
# File 'lib/commands/uptime.rb', line 32 def status @scout.request("uptime.status") end |