Class: SyntaxTree::CLI::ScriptItem

Inherits:
Object
  • Object
show all
Defined in:
lib/syntax_tree/cli.rb

Overview

An item of work that corresponds to a script content passed via the command line.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(source) ⇒ ScriptItem

Returns a new instance of ScriptItem.



66
67
68
# File 'lib/syntax_tree/cli.rb', line 66

def initialize(source)
  @source = source
end

Instance Attribute Details

#sourceObject (readonly)

Returns the value of attribute source.



64
65
66
# File 'lib/syntax_tree/cli.rb', line 64

def source
  @source
end

Instance Method Details

#filepathObject



74
75
76
# File 'lib/syntax_tree/cli.rb', line 74

def filepath
  :script
end

#handlerObject



70
71
72
# File 'lib/syntax_tree/cli.rb', line 70

def handler
  HANDLERS[".rb"]
end

#writable?Boolean

Returns:

  • (Boolean)


78
79
80
# File 'lib/syntax_tree/cli.rb', line 78

def writable?
  false
end