Class: Loom::Shell::Session
- Inherits:
-
Object
- Object
- Loom::Shell::Session
- Defined in:
- lib/loom/shell/session.rb
Instance Attribute Summary collapse
-
#command_results ⇒ Object
readonly
Returns the value of attribute command_results.
Instance Method Summary collapse
- #<<(command_result) ⇒ Object
-
#initialize ⇒ Session
constructor
A new instance of Session.
- #last ⇒ Object
- #success? ⇒ Boolean
Constructor Details
#initialize ⇒ Session
Returns a new instance of Session.
3 4 5 6 |
# File 'lib/loom/shell/session.rb', line 3 def initialize @command_results = [] @success = true end |
Instance Attribute Details
#command_results ⇒ Object (readonly)
Returns the value of attribute command_results.
8 9 10 |
# File 'lib/loom/shell/session.rb', line 8 def command_results @command_results end |
Instance Method Details
#<<(command_result) ⇒ Object
18 19 20 21 22 23 |
# File 'lib/loom/shell/session.rb', line 18 def <<(command_result) @command_results << command_result unless command_result.is_test @success &&= command_result.success? end end |
#last ⇒ Object
14 15 16 |
# File 'lib/loom/shell/session.rb', line 14 def last @command_results.last end |
#success? ⇒ Boolean
10 11 12 |
# File 'lib/loom/shell/session.rb', line 10 def success? @success end |