Class: Riddle::CommandResult

Inherits:
Object
  • Object
show all
Defined in:
lib/riddle/command_result.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(command, status, output = nil, successful = nil) ⇒ CommandResult

Returns a new instance of CommandResult.


7
8
9
10
11
12
13
14
15
# File 'lib/riddle/command_result.rb', line 7

def initialize(command, status, output = nil, successful = nil)
  @command, @status, @output = command, status, output

  if successful.nil?
    @successful = (@status == 0)
  else
    @successful = successful
  end
end

Instance Attribute Details

#commandObject (readonly)

Returns the value of attribute command


4
5
6
# File 'lib/riddle/command_result.rb', line 4

def command
  @command
end

#outputObject (readonly)

Returns the value of attribute output


4
5
6
# File 'lib/riddle/command_result.rb', line 4

def output
  @output
end

#statusObject (readonly)

Returns the value of attribute status


4
5
6
# File 'lib/riddle/command_result.rb', line 4

def status
  @status
end

#successfulObject

Returns the value of attribute successful


5
6
7
# File 'lib/riddle/command_result.rb', line 5

def successful
  @successful
end