Class: Smooth::Command::RunProxy
- Defined in:
- lib/smooth/command/run_proxy.rb
Instance Attribute Summary collapse
-
#cmd ⇒ Object
Returns the value of attribute cmd.
-
#current_user ⇒ Object
Returns the value of attribute current_user.
Instance Method Summary collapse
-
#initialize(current_user, cmd) ⇒ RunProxy
constructor
A new instance of RunProxy.
- #run(*args) ⇒ Object
- #run!(*args) ⇒ Object
Constructor Details
#initialize(current_user, cmd) ⇒ RunProxy
Returns a new instance of RunProxy.
7 8 9 10 |
# File 'lib/smooth/command/run_proxy.rb', line 7 def initialize(current_user, cmd) @current_user = current_user @cmd = cmd end |
Instance Attribute Details
#cmd ⇒ Object
Returns the value of attribute cmd.
5 6 7 |
# File 'lib/smooth/command/run_proxy.rb', line 5 def cmd @cmd end |
#current_user ⇒ Object
Returns the value of attribute current_user.
5 6 7 |
# File 'lib/smooth/command/run_proxy.rb', line 5 def current_user @current_user end |
Instance Method Details
#run(*args) ⇒ Object
16 17 18 |
# File 'lib/smooth/command/run_proxy.rb', line 16 def run(*args) cmd.new(*args).tap { |c| c.current_user = current_user }.run end |
#run!(*args) ⇒ Object
12 13 14 |
# File 'lib/smooth/command/run_proxy.rb', line 12 def run!(*args) cmd.new(*args).tap { |c| c.current_user = current_user }.run! end |