Class: Trenni::Buffer

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

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(string, path: '<string>') ⇒ Buffer

Returns a new instance of Buffer.


23
24
25
26
# File 'lib/trenni/buffer.rb', line 23

def initialize(string, path: '<string>')
	@string = string
	@path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path


28
29
30
# File 'lib/trenni/buffer.rb', line 28

def path
  @path
end

Class Method Details

.load(string) ⇒ Object


38
39
40
# File 'lib/trenni/buffer.rb', line 38

def self.load(string)
	Buffer.new(string)
end

.load_file(path) ⇒ Object


34
35
36
# File 'lib/trenni/buffer.rb', line 34

def self.load_file(path)
	FileBuffer.new(path)
end

Instance Method Details

#readObject


30
31
32
# File 'lib/trenni/buffer.rb', line 30

def read
	@string
end

#to_bufferObject


42
43
44
# File 'lib/trenni/buffer.rb', line 42

def to_buffer
	self
end