COMMANDOES-ACTIVEMODEL
A plugin for the commandos library. This plugin adds ActiveModel to your commandos commands.
PREREQUISITES
- ruby-2.4.0
DEPENDENCIES
- ActiveModel
INSTALLATION
In your Gemfile
gem 'commandos-activemodel'
EXAMPLES
class FooCommand < Commandos::IAmACommand
use Commandos::Plugins::ActiveModelValidationsPlugin
attr_reader :name, :value
def initialize(name: nil, value: nil)
@name = name
@value = value
end
validates_presence_of :name
end