Class: Fort::Src

Inherits:
Object
  • Object
show all
Extended by:
RubyPatch::AutoLoad
Defined in:
lib/fort/src.rb,
lib/fort/src/code.rb,
lib/fort/src/code/program_unit.rb,
lib/fort/src/code/depended_module.rb

Overview

Handle file related informations.

Defined Under Namespace

Classes: Code

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path) ⇒ Src

Returns a new instance of Src.



11
12
13
# File 'lib/fort/src.rb', line 11

def initialize(path)
  @path = Pathname.new(path).expand_path
end

Instance Attribute Details

#pathObject (readonly)

Returns the value of attribute path.



9
10
11
# File 'lib/fort/src.rb', line 9

def path
  @path
end

Instance Method Details

#codeObject



15
16
17
# File 'lib/fort/src.rb', line 15

def code
  @code ||= Code.new(@path.read)
end