Sha256: d45da1d19a6c0b95b936da2c813c65ff9870b27583a6db58b0d2c9cb134d6f57

Contents?: true

Size: 542 Bytes

Versions: 3

Compression:

Stored size: 542 Bytes

Contents

require 'singleton'

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

      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

3 entries across 3 versions & 1 rubygems

Version Path
cantango-config-0.1.2 lib/cantango/configuration/engine.rb
cantango-config-0.1.1 lib/cantango/configuration/engine.rb
cantango-config-0.1.0 lib/cantango/configuration/engine.rb