Class: PseudoTerminal::Buffer

Inherits:
Object
  • Object
show all
Defined in:
lib/pseudo-terminal/buffer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#linesObject

Returns the value of attribute lines.



4
5
6
# File 'lib/pseudo-terminal/buffer.rb', line 4

def lines
  @lines
end

#masksObject

Returns the value of attribute masks.



4
5
6
# File 'lib/pseudo-terminal/buffer.rb', line 4

def masks
  @masks
end

#rawObject

Returns the value of attribute raw.



4
5
6
# File 'lib/pseudo-terminal/buffer.rb', line 4

def raw
  @raw
end

#segmentObject

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