Class: GitRunner::Command::Result
- Inherits:
-
Object
- Object
- GitRunner::Command::Result
- Defined in:
- lib/git-runner/command.rb
Instance Attribute Summary collapse
-
#command ⇒ Object
Returns the value of attribute command.
-
#out ⇒ Object
Returns the value of attribute out.
-
#status ⇒ Object
Returns the value of attribute status.
Instance Method Summary collapse
- #failure? ⇒ Boolean
-
#initialize(command, out, status) ⇒ Result
constructor
A new instance of Result.
- #success? ⇒ Boolean
- #to_s ⇒ Object
Constructor Details
#initialize(command, out, status) ⇒ Result
Returns a new instance of Result.
75 76 77 78 79 |
# File 'lib/git-runner/command.rb', line 75 def initialize(command, out, status) self.command = command self.out = out self.status = status end |
Instance Attribute Details
#command ⇒ Object
Returns the value of attribute command.
72 73 74 |
# File 'lib/git-runner/command.rb', line 72 def command @command end |
#out ⇒ Object
Returns the value of attribute out.
72 73 74 |
# File 'lib/git-runner/command.rb', line 72 def out @out end |
#status ⇒ Object
Returns the value of attribute status.
72 73 74 |
# File 'lib/git-runner/command.rb', line 72 def status @status end |
Instance Method Details
#failure? ⇒ Boolean
85 86 87 |
# File 'lib/git-runner/command.rb', line 85 def failure? !success? end |
#success? ⇒ Boolean
81 82 83 |
# File 'lib/git-runner/command.rb', line 81 def success? status == 0 end |
#to_s ⇒ Object
89 90 91 |
# File 'lib/git-runner/command.rb', line 89 def to_s "Status: #{status}; Command: #{command}\n#{out}" end |