Sha256: 78c2504da5cc26e24e2396836745fd7ff5831098c2207bb31e7e008df0a4f2ad

Contents?: true

Size: 461 Bytes

Versions: 8

Compression:

Stored size: 461 Bytes

Contents

module CanTango
  class Configuration
    module ExecutionModes
      def modes
        @modes ||= [:no_cache]
      end

      def mode= mode_name
        mode_name = mode_name.to_sym
        raise ArgumentError, "Not a valid mode name" if !valid_mode_names.include? mode_name
        @modes = (mode_name == :both) ? [:cache, :no_cache] : [mode_name]
      end

      private

      def valid_mode_names
        [:cache, :no_cache]
      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/execution_modes.rb
cantango-config-0.1.8.1 lib/cantango/configuration/execution_modes.rb
cantango-config-0.1.8 lib/cantango/configuration/execution_modes.rb
cantango-config-0.1.7 lib/cantango/configuration/execution_modes.rb
cantango-config-0.1.6 lib/cantango/configuration/execution_modes.rb
cantango-config-0.1.5 lib/cantango/configuration/execution_modes.rb
cantango-config-0.1.4 lib/cantango/configuration/execution_modes.rb
cantango-config-0.1.3 lib/cantango/configuration/execution_modes.rb