Class: YleTf::Action::Command
- Inherits:
-
Object
- Object
- YleTf::Action::Command
- Defined in:
- lib/yle_tf/action/command.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
readonly
Returns the value of attribute command.
Instance Method Summary collapse
- #call(env) ⇒ Object
-
#initialize(app, command) ⇒ Command
constructor
A new instance of Command.
Constructor Details
#initialize(app, command) ⇒ Command
Returns a new instance of Command.
8 9 10 11 |
# File 'lib/yle_tf/action/command.rb', line 8 def initialize(app, command) @app = app @command = command end |
Instance Attribute Details
#command ⇒ Object (readonly)
Returns the value of attribute command.
6 7 8 |
# File 'lib/yle_tf/action/command.rb', line 6 def command @command end |
Instance Method Details
#call(env) ⇒ Object
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/yle_tf/action/command.rb', line 13 def call(env) if env[:tf_options][:only_hooks] Logger.debug "Skipping command #{command.class} due to `--only-hooks`" else Logger.debug "Executing command #{command.class} with env: #{env.inspect}" command.new.execute(env) end @app.call(env) end |