Sha256: caf8821d3f506bc2943d1bad697148ad8b92615fc6730879428dfba71259e0c3

Contents?: true

Size: 583 Bytes

Versions: 3

Compression:

Stored size: 583 Bytes

Contents

# frozen_string_literal: true

module Consyncful
  class Stats
    def initialize
      @stats = {
        records_added: 0,
        records_updated: 0,
        records_deleted: 0
      }
    end

    def record_added
      @stats[:records_added] += 1
    end

    def record_updated
      @stats[:records_updated] += 1
    end

    def record_deleted
      @stats[:records_deleted] += 1
    end

    def print_stats
      puts "Added: #{@stats[:records_added]}, \
        updated:  #{@stats[:records_updated]}, \
        deleted: #{@stats[:records_deleted]}".blue
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
consyncful-0.3.0 lib/consyncful/stats.rb
consyncful-0.2.0 lib/consyncful/stats.rb
consyncful-0.1.0 lib/consyncful/stats.rb