Class: Saviour::StringSource

Inherits:
Object
  • Object
show all
Defined in:
lib/saviour/string_source.rb

Instance Method Summary collapse

Constructor Details

#initialize(value, filename = nil) ⇒ StringSource

Returns a new instance of StringSource.



3
4
5
6
# File 'lib/saviour/string_source.rb', line 3

def initialize(value, filename = nil)
  @value = StringIO.new(value)
  @filename = filename
end

Instance Method Details

#original_filenameObject



16
17
18
# File 'lib/saviour/string_source.rb', line 16

def original_filename
  @filename
end

#read(*args) ⇒ Object



8
9
10
# File 'lib/saviour/string_source.rb', line 8

def read(*args)
  @value.read(*args)
end

#rewindObject



12
13
14
# File 'lib/saviour/string_source.rb', line 12

def rewind
  @value.rewind
end