Class: XDry::FileRef

Inherits:
BaseFileRef show all
Defined in:
lib/xdry/parsing/pos.rb

Instance Attribute Summary collapse

Attributes inherited from BaseFileRef

#positions

Instance Method Summary collapse

Methods inherited from BaseFileRef

#add_pos!, #fixup_positions!

Constructor Details

#initialize(path) ⇒ FileRef

Returns a new instance of FileRef.



26
27
28
29
# File 'lib/xdry/parsing/pos.rb', line 26

def initialize path
  super()
  @path = path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



24
25
26
# File 'lib/xdry/parsing/pos.rb', line 24

def path
  @path
end

Instance Method Details

#readObject



31
32
33
# File 'lib/xdry/parsing/pos.rb', line 31

def read
  open(@path) { |f| f.read }
end