Class: Subduino::Parse::Bool

Inherits:
Digital
  • Object
show all
Defined in:
lib/subduino/parse/bool.rb

Instance Method Summary collapse

Methods inherited from Digital

#digital?, #graph, #initialize, #name, #raw, #sparkline, #type

Constructor Details

This class inherits a constructor from Subduino::Parse::Digital

Instance Method Details

#parseObject



4
5
6
# File 'lib/subduino/parse/bool.rb', line 4

def parse
  @v.zero? ? false : true
end

#to_sObject



8
9
10
# File 'lib/subduino/parse/bool.rb', line 8

def to_s
  parse ? "ON" : "OFF"
end