Class: Smooth::Command::RunProxy

Inherits:
Object
  • Object
show all
Defined in:
lib/smooth/command/run_proxy.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#cmdObject

Returns the value of attribute cmd.



5
6
7
# File 'lib/smooth/command/run_proxy.rb', line 5

def cmd
  @cmd
end

#current_userObject

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