Sha256: 2763bca1b6344a4b80b5cab2b6a91bc414fd419d6f53917a580bc353832286d3

Contents?: true

Size: 756 Bytes

Versions: 1

Compression:

Stored size: 756 Bytes

Contents

module Milkmaid
  class FirebaseNotifier < ::Milkmaid::ConsoleNotifier
    attr_accessor :batch_record

    def batch_completed
      super
      batch_record.complete!
    end

    def batch_started(batch_data = {})
      super(batch_data)
      batch_record = ::Milkmaid::FirebaseNotifier::BatchRecord.new(batch_data)
    end

    def log_temperature(temperature)
      super(temperature)
      batch_record.add_event(:temperature, temperature)
    end

    def post_warning(current_temperature, base_temperature)
      super(current_temperature, base_temperature)
      batch_record.add_event(:temperature_warning, current_temperature)
    end

    def temperature_reached
      super
      batch_record.add_event(:threshold_reached)
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
milk_maid-0.1.0 lib/milkmaid/firebase_notifier.rb