Method: CommandMapper::Command#initialize
- Defined in:
- lib/command_mapper/command.rb
#initialize(params = {}, command_name: self.class.command_name, command_path: nil, command_env: {}, **kwargs) {|self| ... } ⇒ Command
Initializes the command.
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
# File 'lib/command_mapper/command.rb', line 71 def initialize(params={}, command_name: self.class.command_name, command_path: nil, command_env: {}, **kwargs) @command_name = command_name @command_path = command_path @command_env = command_env params = params.merge(kwargs) params.each do |name,value| self[name] = value end yield self if block_given? end |