Sha256: 2f81b3dbb393772ceefd28ec6b6aa07af15f47f27f3c3e59bf1c7d7dcce6e205

Contents?: true

Size: 810 Bytes

Versions: 13

Compression:

Stored size: 810 Bytes

Contents

module MilkMaid
  class ParseNotifier < ::MilkMaid::ConsoleNotifier
    attr_accessor :batch_record

    def batch_completed
      super
      batch_record.complete!
    end

    def batch_record
      @batch_record ||= ::MilkMaid::FirebaseNotifier::BatchRecord.new
    end

    def batch_started(batch_data = {})
      super(batch_data)
      batch_record.start(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

13 entries across 13 versions & 1 rubygems

Version Path
milk_maid-0.6.1 lib/milk_maid/parse_notifier.rb
milk_maid-0.5.1 lib/milk_maid/parse_notifier.rb
milk_maid-0.5.0 lib/milk_maid/parse_notifier.rb
milk_maid-0.4.0 lib/milk_maid/parse_notifier.rb
milk_maid-0.3.0 lib/milk_maid/parse_notifier.rb
milk_maid-0.2.8 lib/milk_maid/parse_notifier.rb
milk_maid-0.2.7 lib/milk_maid/parse_notifier.rb
milk_maid-0.2.6 lib/milk_maid/parse_notifier.rb
milk_maid-0.2.5 lib/milk_maid/parse_notifier.rb
milk_maid-0.2.4 lib/milk_maid/parse_notifier.rb
milk_maid-0.2.3 lib/milk_maid/parse_notifier.rb
milk_maid-0.2.2 lib/milk_maid/parse_notifier.rb
milk_maid-0.2.0 lib/milk_maid/parse_notifier.rb