Sha256: 0b4be763697f622a36f136a255a2e0a768386676ae95692be04d126e078ff64b

Contents?: true

Size: 471 Bytes

Versions: 8

Compression:

Stored size: 471 Bytes

Contents

module CanTango
  class Configuration
    module Modes
      def modes
        @modes ||= [:cache, :no_cache]
      end

      def mode= mode_name
        mode_name = mode_name.to_sym
        raise ArgumentException, "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, :both]
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

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