Class: Specinfra::CommandFactory
- Inherits:
-
Object
- Object
- Specinfra::CommandFactory
- Defined in:
- lib/specinfra/command_factory.rb
Constant Summary collapse
- @@types =
nil
Class Method Summary collapse
Class Method Details
.get(meth, *args) ⇒ Object
5 6 7 8 9 10 11 12 13 14 15 |
# File 'lib/specinfra/command_factory.rb', line 5 def get(meth, *args) action, resource_type, subaction = breakdown(meth) method = action method += "_#{subaction}" if subaction command_class = create_command_class(resource_type) if command_class.respond_to?(method) command_class.send(method, *args) else raise NotImplementedError.new("#{method} is not implemented in #{command_class}") end end |