Class: Bricolage::JobNet::Location
- Inherits:
-
Object
- Object
- Bricolage::JobNet::Location
- Defined in:
- lib/bricolage/jobnet.rb
Instance Attribute Summary collapse
-
#file ⇒ Object
readonly
Returns the value of attribute file.
-
#lineno ⇒ Object
readonly
Returns the value of attribute lineno.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(file, lineno) ⇒ Location
constructor
A new instance of Location.
- #inspect ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(file, lineno) ⇒ Location
Returns a new instance of Location.
481 482 483 484 |
# File 'lib/bricolage/jobnet.rb', line 481 def initialize(file, lineno) @file = file @lineno = lineno end |
Instance Attribute Details
#file ⇒ Object (readonly)
Returns the value of attribute file.
486 487 488 |
# File 'lib/bricolage/jobnet.rb', line 486 def file @file end |
#lineno ⇒ Object (readonly)
Returns the value of attribute lineno.
487 488 489 |
# File 'lib/bricolage/jobnet.rb', line 487 def lineno @lineno end |
Class Method Details
.dummy ⇒ Object
461 462 463 |
# File 'lib/bricolage/jobnet.rb', line 461 def Location.dummy new('(dummy)', 0) end |
.for_file(f) ⇒ Object
465 466 467 |
# File 'lib/bricolage/jobnet.rb', line 465 def Location.for_file(f) new(f.path, f.lineno) end |
.for_io(io) ⇒ Object
473 474 475 476 477 478 479 |
# File 'lib/bricolage/jobnet.rb', line 473 def Location.for_io(io) if io.respond_to?(:path) for_file(io) else for_non_file(io) end end |
.for_non_file(io) ⇒ Object
469 470 471 |
# File 'lib/bricolage/jobnet.rb', line 469 def Location.for_non_file(io) new(io.inspect, io.lineno) end |
Instance Method Details
#inspect ⇒ Object
489 490 491 |
# File 'lib/bricolage/jobnet.rb', line 489 def inspect "\#<#{self.class} #{to_s}>" end |
#to_s ⇒ Object
493 494 495 |
# File 'lib/bricolage/jobnet.rb', line 493 def to_s "#{@file}:#{@lineno}" end |