class SyntaxTree::CLI::FileItem

An item of work that corresponds to a file to be processed.

Attributes

filepath[R]

Public Class Methods

new(filepath) click to toggle source
# File lib/syntax_tree/cli.rb, line 44
def initialize(filepath)
  @filepath = filepath
end

Public Instance Methods

handler() click to toggle source
# File lib/syntax_tree/cli.rb, line 48
def handler
  HANDLERS[File.extname(filepath)]
end
source() click to toggle source
# File lib/syntax_tree/cli.rb, line 52
def source
  handler.read(filepath)
end
writable?() click to toggle source
# File lib/syntax_tree/cli.rb, line 56
def writable?
  File.writable?(filepath)
end