Class: SyntaxTree::CLI::FileItem
- Inherits:
-
Object
- Object
- SyntaxTree::CLI::FileItem
- Defined in:
- lib/syntax_tree/cli.rb
Overview
An item of work that corresponds to a file to be processed.
Instance Attribute Summary collapse
-
#filepath ⇒ Object
readonly
Returns the value of attribute filepath.
Instance Method Summary collapse
- #handler ⇒ Object
-
#initialize(filepath) ⇒ FileItem
constructor
A new instance of FileItem.
- #source ⇒ Object
Constructor Details
#initialize(filepath) ⇒ FileItem
Returns a new instance of FileItem.
41 42 43 |
# File 'lib/syntax_tree/cli.rb', line 41 def initialize(filepath) @filepath = filepath end |
Instance Attribute Details
#filepath ⇒ Object (readonly)
Returns the value of attribute filepath.
39 40 41 |
# File 'lib/syntax_tree/cli.rb', line 39 def filepath @filepath end |
Instance Method Details
#handler ⇒ Object
45 46 47 |
# File 'lib/syntax_tree/cli.rb', line 45 def handler HANDLERS[File.extname(filepath)] end |
#source ⇒ Object
49 50 51 |
# File 'lib/syntax_tree/cli.rb', line 49 def source handler.read(filepath) end |