Sha256: d2ace75b88633aa4447eb07e0db4d722250530e5f1ca1ee58ea585ef52bb2d8e

Contents?: true

Size: 446 Bytes

Versions: 3

Compression:

Stored size: 446 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]
    end

    def on
      @value = :on

      log "Pin #{pin} on"
    end

    def off
      @value = :off

      log "Pin #{pin} off"
    end

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

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
whipped-cream-0.0.1pre3 lib/whipped-cream/pi_piper.rb
whipped-cream-0.0.1pre2 lib/whipped-cream/pi_piper.rb
whipped-cream-0.0.1pre1 lib/whipped-cream/pi_piper.rb