Class: Zerbo::SleepStage
Constant Summary
collapse
- LOOKUP =
[
'Undefined',
'Awake',
'REM',
'Light',
'Deep'
]
Instance Attribute Summary
Attributes inherited from Packet
#data, #owner, #sequence, #type
Instance Method Summary
collapse
Methods inherited from Packet
#guess_length, inherited, #initialize, #name, #to_i
Constructor Details
This class inherits a constructor from Zerbo::Packet
Instance Method Details
#asleep? ⇒ Boolean
278
279
280
|
# File 'lib/zerbo.rb', line 278
def asleep?
rem? || light? || deep?
end
|
#awake? ⇒ Boolean
274
275
276
|
# File 'lib/zerbo.rb', line 274
def awake?
to_s == 'Awake'
end
|
#deep? ⇒ Boolean
290
291
292
|
# File 'lib/zerbo.rb', line 290
def deep?
to_s == 'Deep'
end
|
#inspect ⇒ Object
270
271
272
|
# File 'lib/zerbo.rb', line 270
def inspect
format_inspect(to_s)
end
|
#light? ⇒ Boolean
286
287
288
|
# File 'lib/zerbo.rb', line 286
def light?
to_s == 'Light'
end
|
#rem? ⇒ Boolean
282
283
284
|
# File 'lib/zerbo.rb', line 282
def rem?
to_s == 'REM'
end
|
#to_s ⇒ Object
266
267
268
|
# File 'lib/zerbo.rb', line 266
def to_s
LOOKUP[to_i]
end
|