Class: PseudoTerminal::Buffer
- Inherits:
-
Object
- Object
- PseudoTerminal::Buffer
- Defined in:
- lib/pseudo-terminal/buffer.rb
Instance Attribute Summary collapse
-
#lines ⇒ Object
Returns the value of attribute lines.
-
#masks ⇒ Object
Returns the value of attribute masks.
-
#raw ⇒ Object
Returns the value of attribute raw.
-
#segment ⇒ Object
Returns the value of attribute segment.
Instance Method Summary collapse
- #<<(str) ⇒ Object
-
#initialize(str_ready, masks = []) ⇒ Buffer
constructor
A new instance of Buffer.
Constructor Details
#initialize(str_ready, masks = []) ⇒ Buffer
Returns a new instance of Buffer.
6 7 8 9 10 11 12 13 |
# File 'lib/pseudo-terminal/buffer.rb', line 6 def initialize str_ready, masks=[] @raw = '' @segment = '' @lines = [] @buff_a = [] @masks = masks @ready = str_ready.to_s end |
Instance Attribute Details
#lines ⇒ Object
Returns the value of attribute lines.
4 5 6 |
# File 'lib/pseudo-terminal/buffer.rb', line 4 def lines @lines end |
#masks ⇒ Object
Returns the value of attribute masks.
4 5 6 |
# File 'lib/pseudo-terminal/buffer.rb', line 4 def masks @masks end |
#raw ⇒ Object
Returns the value of attribute raw.
4 5 6 |
# File 'lib/pseudo-terminal/buffer.rb', line 4 def raw @raw end |
#segment ⇒ Object
Returns the value of attribute segment.
4 5 6 |
# File 'lib/pseudo-terminal/buffer.rb', line 4 def segment @segment end |
Instance Method Details
#<<(str) ⇒ Object
15 16 17 18 19 20 |
# File 'lib/pseudo-terminal/buffer.rb', line 15 def << str buffer = str.to_s @raw << buffer process_raw(buffer) # lines end |