Class: Nydp::StringReader

Inherits:
Object show all
Defined in:
lib/nydp/runner.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(name, string) ⇒ StringReader

Returns a new instance of StringReader.



9
10
11
# File 'lib/nydp/runner.rb', line 9

def initialize name, string
  @name, @string, @read = name, string, string
end

Instance Attribute Details

#nameObject

Returns the value of attribute name.



7
8
9
# File 'lib/nydp/runner.rb', line 7

def name
  @name
end

Instance Method Details

#nextlineObject



13
14
15
# File 'lib/nydp/runner.rb', line 13

def nextline
  s = @read ; @read = nil ; s
end

#readObject



17
18
19
# File 'lib/nydp/runner.rb', line 17

def read
  @string
end