Class: HecksApplication::CommandRunner
- Inherits:
-
Object
- Object
- HecksApplication::CommandRunner
- Defined in:
- lib/command_runner.rb
Overview
Run an application command, with validations and broacast lifecycle events
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
-
#module_name ⇒ Object
readonly
Returns the value of attribute module_name.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(command_name:, module_name:, args:, application:, async: false) ⇒ CommandRunner
constructor
A new instance of CommandRunner.
Constructor Details
#initialize(command_name:, module_name:, args:, application:, async: false) ⇒ CommandRunner
Returns a new instance of CommandRunner.
8 9 10 11 12 13 14 15 |
# File 'lib/command_runner.rb', line 8 def initialize(command_name:, module_name:, args:, application:, async: false) @command_name = command_name @module_name = module_name @args = args @application = application @domain_spec = application.domain_spec @async = async end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
6 7 8 |
# File 'lib/command_runner.rb', line 6 def command @command end |
#module_name ⇒ Object (readonly)
Returns the value of attribute module_name.
6 7 8 |
# File 'lib/command_runner.rb', line 6 def module_name @module_name end |
Instance Method Details
#call ⇒ Object
17 18 19 20 21 22 |
# File 'lib/command_runner.rb', line 17 def call() fetch_command run_command broadcast command end |