Class: ComposedCommands::CommandFactory

Inherits:
Object
  • Object
show all
Defined in:
lib/composed_commands/command_factory.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, options = {}) ⇒ CommandFactory

Returns a new instance of CommandFactory.



4
5
6
7
# File 'lib/composed_commands/command_factory.rb', line 4

def initialize(command, options = {})
  @command = command
  @options = options
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



3
4
5
# File 'lib/composed_commands/command_factory.rb', line 3

def command
  @command
end

Instance Method Details

#createObject



9
10
11
# File 'lib/composed_commands/command_factory.rb', line 9

def create
  @command.new(@options)
end