Class: Bcome::Ssh::Window
- Inherits:
-
Object
- Object
- Bcome::Ssh::Window
- Includes:
- Singleton
- Defined in:
- lib/objects/ssh/window.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
readonly
Returns the value of attribute lines.
Instance Method Summary collapse
- #add(node, log_line) ⇒ Object
-
#initialize(*_params) ⇒ Window
constructor
A new instance of Window.
- #pop ⇒ Object
Constructor Details
#initialize(*_params) ⇒ Window
Returns a new instance of Window.
10 11 12 |
# File 'lib/objects/ssh/window.rb', line 10 def initialize(*_params) @lines = [] end |
Instance Attribute Details
#lines ⇒ Object (readonly)
Returns the value of attribute lines.
6 7 8 |
# File 'lib/objects/ssh/window.rb', line 6 def lines @lines end |
Instance Method Details
#add(node, log_line) ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/objects/ssh/window.rb', line 14 def add(node, log_line) multi_line = log_line =~ /\n/ ? true : false @lines << if ::Bcome::Orchestrator.instance.is_multi_node? "\n#{node.namespace}".terminal_prompt + "\n#{log_line}" else log_line end pop end |
#pop ⇒ Object
26 27 28 |
# File 'lib/objects/ssh/window.rb', line 26 def pop print @lines.pop end |