class SimpleRaspberryPi
Public Class Methods
new(x=[])
click to toggle source
# File lib/simple_raspberrypi.rb, line 14 def initialize(x=[]) a = case x when Integer [x] when Fixnum [x] when String [x] when Array x end @pins = a.map {|pin| RPiPinOut.new pin } def @pins.[](i) if i.to_i >= self.length then puts "RPi warning: RPiPinOut instance #{i.inspect} not found" PinX::Void.new else self.at(i) end end end
Public Instance Methods
pin()
click to toggle source
# File lib/simple_raspberrypi.rb, line 41 def pin() @pins.first end
pins()
click to toggle source
# File lib/simple_raspberrypi.rb, line 42 def pins() @pins end