Class: Loom::Shell::Session

Inherits:
Object
  • Object
show all
Defined in:
lib/loom/shell/session.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeSession

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_resultsObject (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

#lastObject



14
15
16
# File 'lib/loom/shell/session.rb', line 14

def last
  @command_results.last
end

#success?Boolean

Returns:

  • (Boolean)


10
11
12
# File 'lib/loom/shell/session.rb', line 10

def success?
  @success
end