Sha256: aa84cc527efa7947c6f6bdb2852c7f3721600a0837fb292cbd82215f3e41306f

Contents?: true

Size: 881 Bytes

Versions: 5

Compression:

Stored size: 881 Bytes

Contents

module Knapsack
  module Adapters
    class BaseAdapter
      def self.bind
        adapter = new
        adapter.bind
        adapter
      end

      def bind
        if tracker.config[:generate_report]
          puts 'Knapsack report generator started!'
          bind_time_tracker
          bind_report_generator
        elsif tracker.config[:enable_time_offset_warning]
          puts 'Knapsack time offset warning enabled!'
          bind_time_tracker
          bind_time_offset_warning
        else
          puts 'Knapsack is off!'
        end
      end

      def bind_time_tracker
        raise NotImplementedError
      end

      def bind_report_generator
        raise NotImplementedError
      end

      def bind_time_offset_warning
        raise NotImplementedError
      end

      protected

      def tracker
        Knapsack.tracker
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
knapsack-0.1.4 lib/knapsack/adapters/base_adapter.rb
knapsack-0.1.3 lib/knapsack/adapters/base_adapter.rb
knapsack-0.1.2 lib/knapsack/adapters/base_adapter.rb
knapsack-0.1.1 lib/knapsack/adapters/base_adapter.rb
knapsack-0.1.0 lib/knapsack/adapters/base_adapter.rb