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.



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

def initialize(command)
  @command = command
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command.



3
4
5
# File 'lib/aws_mfa/shell_command.rb', line 3

def command
  @command
end

Instance Method Details

#callObject



9
10
11
12
# File 'lib/aws_mfa/shell_command.rb', line 9

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