Class: Geppeto::Commands::Uptime

Inherits:
Object
  • Object
show all
Defined in:
lib/commands/uptime.rb

Instance Method Summary collapse

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

#awakeObject



36
37
38
39
# File 'lib/commands/uptime.rb', line 36

def awake
  @context = :awake
  self
end

#getlastresetObject



28
29
30
# File 'lib/commands/uptime.rb', line 28

def getlastreset
  @scout.request("uptime.getlastreset")
end

#microsObject



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

#reportObject



24
25
26
# File 'lib/commands/uptime.rb', line 24

def report
  @scout.request("uptime.report")
end

#secondsObject



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

#sleepingObject



41
42
43
44
# File 'lib/commands/uptime.rb', line 41

def sleeping
  @context = :sleeping
  self
end

#statusObject



32
33
34
# File 'lib/commands/uptime.rb', line 32

def status
  @scout.request("uptime.status")
end