Class: Svnx::Base::CommandFactory

Inherits:
Object
  • Object
show all
Includes:
Logue::Loggable
Defined in:
lib/svnx/base/command_factory.rb

Instance Method Summary collapse

Constructor Details

#initialize(cmdlinefactory = CommandLineFactory.new) ⇒ CommandFactory

Returns a new instance of CommandFactory.



21
22
23
# File 'lib/svnx/base/command_factory.rb', line 21

def initialize cmdlinefactory = CommandLineFactory.new
  @cmdlinefactory = cmdlinefactory
end

Instance Method Details

#command_line_factoryObject



36
37
38
# File 'lib/svnx/base/command_factory.rb', line 36

def command_line_factory
  @cmdlinefactory
end

#create(cmdcls, cmdlinecls: nil) ⇒ Object



25
26
27
28
29
30
31
32
33
34
# File 'lib/svnx/base/command_factory.rb', line 25

def create cmdcls, cmdlinecls: nil
  melements = ClassUtil.module_elements cmdcls
  
  optcls = begin
             modl = ClassUtil.find_module cmdcls
             modl::Options
           end
  
  CommandParams.new options: optcls, subcommand: melements[-1].downcase
end