Sha256: 32e4a4d08ab8e01287cde49aa7d21e4e48e7ce6eddd5445f8bd67861b1730f4a

Contents?: true

Size: 459 Bytes

Versions: 1

Compression:

Stored size: 459 Bytes

Contents

# Fake PiPiper
module PiPiper
  # Just enough to imitate a pin
  class Pin
    attr_reader :pin, :direction, :value

    def initialize(options)
      @pin = options[:pin]
      @direction = options[:direction]

      @value = 0
    end

    def on
      @value = 1

      log "Pin #{pin} on"
    end

    def off
      @value = 0

      log "Pin #{pin} off"
    end

    def log(message)
      puts message unless ENV['RUBY_ENV'] == 'test'
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
whipped-cream-0.0.1pre4 lib/whipped-cream/pi_piper.rb