Class: Bricolage::JobNet::JobNetRef

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

Instance Attribute Summary collapse

Attributes inherited from Ref

#location, #name, #subsystem

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Ref

#==, #dummy?, #hash, #inspect, parse

Constructor Details

#initialize(subsys, name, location) ⇒ JobNetRef

Returns a new instance of JobNetRef.



386
387
388
389
390
391
# File 'lib/bricolage/jobnet.rb', line 386

def initialize(subsys, name, location)
  super
  @jobnet = nil
  @start = nil
  @end = nil
end

Instance Attribute Details

#jobnetObject

Returns the value of attribute jobnet.



393
394
395
# File 'lib/bricolage/jobnet.rb', line 393

def jobnet
  @jobnet
end

Class Method Details

.for_job_path(path) ⇒ Object



377
378
379
380
381
382
383
384
# File 'lib/bricolage/jobnet.rb', line 377

def JobNetRef.for_job_path(path)
  basename = path
  # remove all extnames
  until (ext = basename.extname).empty?
    basename = basename.basename(ext)
  end
  new(path.parent.basename, basename, Location.dummy)
end

.for_path(path) ⇒ Object



373
374
375
# File 'lib/bricolage/jobnet.rb', line 373

def JobNetRef.for_path(path)
  new(path.parent.basename, path.basename('.jobnet'), Location.dummy)
end

Instance Method Details

#endObject



420
421
422
# File 'lib/bricolage/jobnet.rb', line 420

def end
  @jobnet.end
end

#end_refObject



411
412
413
# File 'lib/bricolage/jobnet.rb', line 411

def end_ref
  @end ||= JobRef.new(subsystem, "@#{name}@end", location)
end

#net?Boolean

Returns:

  • (Boolean)


395
396
397
# File 'lib/bricolage/jobnet.rb', line 395

def net?
  true
end

#relative_pathObject



403
404
405
# File 'lib/bricolage/jobnet.rb', line 403

def relative_path
  "#{subsystem}/#{name}.jobnet"
end

#startObject



416
417
418
# File 'lib/bricolage/jobnet.rb', line 416

def start
  @jobnet.start
end

#start_refObject



407
408
409
# File 'lib/bricolage/jobnet.rb', line 407

def start_ref
  @start ||= JobRef.new(subsystem, "@#{name}@start", location)
end

#to_sObject



399
400
401
# File 'lib/bricolage/jobnet.rb', line 399

def to_s
  '*' + super
end