Sha256: fdc5029e985b2c70599def06326c42bc22243eddac7dac98e5cabf099652661f

Contents?: true

Size: 612 Bytes

Versions: 7

Compression:

Stored size: 612 Bytes

Contents

require 'singleton'

module CanTango
  class Configuration
    class Engines
      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
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
cantango-0.9.4.7 lib/cantango/configuration/engines/engine.rb
cantango-0.9.4.6 lib/cantango/configuration/engines/engine.rb
cantango-0.9.4.5 lib/cantango/configuration/engines/engine.rb
cantango-0.9.4.3 lib/cantango/configuration/engines/engine.rb
cantango-0.9.4.2 lib/cantango/configuration/engines/engine.rb
cantango-0.9.4.1 lib/cantango/configuration/engines/engine.rb
cantango-0.9.4 lib/cantango/configuration/engines/engine.rb