Class: Strut::SlimCommandFactory
- Inherits:
-
Object
- Object
- Strut::SlimCommandFactory
- Defined in:
- lib/strut/slim_command_factory.rb
Instance Method Summary collapse
-
#initialize ⇒ SlimCommandFactory
constructor
A new instance of SlimCommandFactory.
- #make_call_command(metadata, instance, property, value = nil) ⇒ Object
- #make_import_command(metadata, namespace) ⇒ Object
- #make_make_command(metadata, instance, class_name) ⇒ Object
- #next_command_id ⇒ Object
Constructor Details
#initialize ⇒ SlimCommandFactory
Returns a new instance of SlimCommandFactory.
5 6 7 |
# File 'lib/strut/slim_command_factory.rb', line 5 def initialize @command_id = 0 end |
Instance Method Details
#make_call_command(metadata, instance, property, value = nil) ⇒ Object
24 25 26 27 |
# File 'lib/strut/slim_command_factory.rb', line 24 def make_call_command(, instance, property, value = nil) id = next_command_id CallCommand.new(id, , instance, property, value) end |
#make_import_command(metadata, namespace) ⇒ Object
14 15 16 17 |
# File 'lib/strut/slim_command_factory.rb', line 14 def make_import_command(, namespace) id = next_command_id ImportCommand.new(id, , namespace) end |
#make_make_command(metadata, instance, class_name) ⇒ Object
19 20 21 22 |
# File 'lib/strut/slim_command_factory.rb', line 19 def make_make_command(, instance, class_name) id = next_command_id MakeCommand.new(id, , instance, class_name) end |
#next_command_id ⇒ Object
9 10 11 12 |
# File 'lib/strut/slim_command_factory.rb', line 9 def next_command_id @command_id += 1 @command_id.to_s end |