Class: Trenni::IOBuffer

Inherits:
Object
  • Object
show all
Defined in:
lib/trenni/buffer.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(io, path: io.inspect) ⇒ IOBuffer

Returns a new instance of IOBuffer.


64
65
66
67
# File 'lib/trenni/buffer.rb', line 64

def initialize(io, path: io.inspect)
	@io = io
	@path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path


69
70
71
# File 'lib/trenni/buffer.rb', line 69

def path
  @path
end

Instance Method Details

#readObject


71
72
73
# File 'lib/trenni/buffer.rb', line 71

def read
	@io.read
end

#to_bufferObject


75
76
77
# File 'lib/trenni/buffer.rb', line 75

def to_buffer
	Buffer.new(self.read, path: @path)
end