Class: BitClust::Location

Inherits:
Object show all
Defined in:
lib/bitclust/parseutils.rb

Overview

Encapsulates :file and :line. Used by LineStream(above)

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(file, line) ⇒ Location

Returns a new instance of Location.



42
43
44
45
# File 'lib/bitclust/parseutils.rb', line 42

def initialize(file, line)
  @file = file
  @line = line
end

Instance Attribute Details

#fileObject (readonly)

Returns the value of attribute file.



47
48
49
# File 'lib/bitclust/parseutils.rb', line 47

def file
  @file
end

#lineObject (readonly)

Returns the value of attribute line.



48
49
50
# File 'lib/bitclust/parseutils.rb', line 48

def line
  @line
end

Instance Method Details

#inspectObject



54
55
56
# File 'lib/bitclust/parseutils.rb', line 54

def inspect
  "\#<#{self.class} #{@file}:#{@line}>"
end

#to_sObject



50
51
52
# File 'lib/bitclust/parseutils.rb', line 50

def to_s
  "#{@file}:#{@line}"
end