Class: AwsMfa::ShellCommand

Inherits:
Object
  • Object
show all
Defined in:
lib/aws_mfa/shell_command.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command) ⇒ ShellCommand

Returns a new instance of ShellCommand.



7
8
9
# File 'lib/aws_mfa/shell_command.rb', line 7

def initialize(command)
  @command = command
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



5
6
7
# File 'lib/aws_mfa/shell_command.rb', line 5

def command
  @command
end

Instance Method Details

#callObject



11
12
13
14
# File 'lib/aws_mfa/shell_command.rb', line 11

def call
  output = `#{command}`
  ShellCommandResult.new(output, $?)
end