class SimpleCommand::Dispatcher::Configuration

Gem configuration settings class. Use this class to configure this gem.

To configure this gem in your application, simply add the following code in your application and set the appropriate configuration settings.

@example

SimpleCommand::Dispatcher.configure do |config|
   config.allow_custom_commands = true
end

Attributes

allow_custom_commands[RW]

Gets/sets the allow_custom_commands configuration setting (defaults to false). If this setting is set to false, only command classes that prepend the SimpleCommand module will be considered acceptable to run, all other command classes will fail to run. If this setting is set to true, any command class will be considered acceptable to run, regardless of whether or not the class prepends the SimpleCommand module.

For information about the simple_command gem, visit {rubygems.org/gems/simple_command}

@return [Boolean] the value.

Public Class Methods

new() click to toggle source
# File lib/simple_command_dispatcher/configuration.rb, line 28
        def initialize
                # The default is to use any command that exposes a ::call class method.
reset
end

Public Instance Methods

reset() click to toggle source

Resets the configuration to use the default values.

@return [nil] returns nil.

# File lib/simple_command_dispatcher/configuration.rb, line 39
    def reset
            @allow_custom_commands = false
nil
    end