Class: SyntaxTree::Index::FileComments::FileSource
- Inherits:
-
Object
- Object
- SyntaxTree::Index::FileComments::FileSource
- Defined in:
- lib/syntax_tree/index.rb
Overview
This represents the Ruby source in the form of a file. When it needs to be read we’ll read the file.
Instance Attribute Summary collapse
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
Instance Method Summary collapse
-
#initialize(filepath) ⇒ FileSource
constructor
A new instance of FileSource.
- #source ⇒ Object
Constructor Details
#initialize(filepath) ⇒ FileSource
Returns a new instance of FileSource.
118 119 120 |
# File 'lib/syntax_tree/index.rb', line 118 def initialize(filepath) @filepath = filepath end |
Instance Attribute Details
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
116 117 118 |
# File 'lib/syntax_tree/index.rb', line 116 def filepath @filepath end |
Instance Method Details
#source ⇒ Object
122 123 124 |
# File 'lib/syntax_tree/index.rb', line 122 def source File.read(filepath) end |