Sha256: dde48eec258a7b7162995b63fd86313eb5a9ac667e8c421b27d81c4e25aed5ef

Contents?: true

Size: 551 Bytes

Versions: 8

Compression:

Stored size: 551 Bytes

Contents

require 'singleton'

module CanTango
  class Configuration
    class Engine
      include Singleton
      include CanTango::Configuration::ExecutionModes

      def set state = :on
        raise ArgumentError, "Must be :on or :off" unless !state || [:on, :off].include?(state)
        @state = state || :on
      end

      def reset!
        @state = nil
      end

      def on?
        @state == :on
      end

      def off?
        !on?
      end

      protected

      def ns
        CanTango::Configuration::Engines
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
cantango-config-0.1.9.2 lib/cantango/configuration/engine.rb
cantango-config-0.1.8.1 lib/cantango/configuration/engine.rb
cantango-config-0.1.8 lib/cantango/configuration/engine.rb
cantango-config-0.1.7 lib/cantango/configuration/engine.rb
cantango-config-0.1.6 lib/cantango/configuration/engine.rb
cantango-config-0.1.5 lib/cantango/configuration/engine.rb
cantango-config-0.1.4 lib/cantango/configuration/engine.rb
cantango-config-0.1.3 lib/cantango/configuration/engine.rb