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.
93 94 95 |
# File 'lib/syntax_tree/index.rb', line 93 def initialize(filepath) @filepath = filepath end |
Instance Attribute Details
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
91 92 93 |
# File 'lib/syntax_tree/index.rb', line 91 def filepath @filepath end |
Instance Method Details
#source ⇒ Object
97 98 99 |
# File 'lib/syntax_tree/index.rb', line 97 def source File.read(filepath) end |