Class: CommandBuilderGenerator::CommandCodeNames
- Inherits:
-
Object
- Object
- CommandBuilderGenerator::CommandCodeNames
- Defined in:
- lib/command_builder_generator/command_code_names.rb
Instance Method Summary collapse
- #command_factory_method_call ⇒ Object
- #command_factory_method_name ⇒ Object
- #command_factory_method_signature ⇒ Object
- #command_initializer_call ⇒ Object
- #command_module_name ⇒ Object
- #create_method_call ⇒ Object
- #create_method_signature ⇒ Object
-
#initialize(command, version = nil) ⇒ CommandCodeNames
constructor
A new instance of CommandCodeNames.
- #version_factory_method_name ⇒ Object
- #version_factory_method_signature ⇒ Object
- #version_module_name ⇒ Object
Constructor Details
#initialize(command, version = nil) ⇒ CommandCodeNames
Returns a new instance of CommandCodeNames.
6 7 8 9 |
# File 'lib/command_builder_generator/command_code_names.rb', line 6 def initialize(command, version=nil) @command = command @compact_version = version.to_s.gsub('.', '_') end |
Instance Method Details
#command_factory_method_call ⇒ Object
43 44 45 |
# File 'lib/command_builder_generator/command_code_names.rb', line 43 def command_factory_method_call format_method command_factory_method_name, initializer_values end |
#command_factory_method_name ⇒ Object
19 20 21 |
# File 'lib/command_builder_generator/command_code_names.rb', line 19 def command_factory_method_name @command.node_name.downcase.snakecase end |
#command_factory_method_signature ⇒ Object
23 24 25 |
# File 'lib/command_builder_generator/command_code_names.rb', line 23 def command_factory_method_signature format_method command_factory_method_name, factory_method_args end |
#command_initializer_call ⇒ Object
47 48 49 |
# File 'lib/command_builder_generator/command_code_names.rb', line 47 def command_initializer_call format_method "#{class_name}.new", initializer_values end |
#command_module_name ⇒ Object
11 12 13 |
# File 'lib/command_builder_generator/command_code_names.rb', line 11 def command_module_name @command.node_name.camelcase end |
#create_method_call ⇒ Object
39 40 41 |
# File 'lib/command_builder_generator/command_code_names.rb', line 39 def create_method_call format_method "CommandBuilder::#{command_module_name}::#{version_module_name}.create", initializer_values end |
#create_method_signature ⇒ Object
35 36 37 |
# File 'lib/command_builder_generator/command_code_names.rb', line 35 def create_method_signature format_method 'self.create', factory_method_args end |
#version_factory_method_name ⇒ Object
27 28 29 |
# File 'lib/command_builder_generator/command_code_names.rb', line 27 def version_factory_method_name "#{command_factory_method_name}_#{@compact_version.downcase.snakecase}" end |
#version_factory_method_signature ⇒ Object
31 32 33 |
# File 'lib/command_builder_generator/command_code_names.rb', line 31 def version_factory_method_signature format_method version_factory_method_name, factory_method_args end |
#version_module_name ⇒ Object
15 16 17 |
# File 'lib/command_builder_generator/command_code_names.rb', line 15 def version_module_name "V#{@compact_version}" end |