Class: Bricolage::JobNet::Parser

Inherits:
Object
  • Object
show all
Defined in:
lib/bricolage/jobnet.rb

Instance Method Summary collapse

Constructor Details

#initialize(jobnet_ref) ⇒ Parser

Returns a new instance of Parser.



295
296
297
# File 'lib/bricolage/jobnet.rb', line 295

def initialize(jobnet_ref)
  @jobnet_ref = jobnet_ref
end

Instance Method Details

#parse_stream(io) ⇒ Object



299
300
301
302
303
304
305
# File 'lib/bricolage/jobnet.rb', line 299

def parse_stream(io)
  net = JobNet.new(@jobnet_ref, Location.for_io(io))
  foreach_edge(io) do |src, dest|
    net.add_edge src, dest
  end
  net
end