Class: HamlLint::Tree::ScriptNode
- Defined in:
- lib/haml_lint/tree/script_node.rb
Overview
Represents a node which produces output based on Ruby code.
Instance Attribute Summary
Attributes inherited from Node
#children, #line, #parent, #type
Instance Method Summary collapse
-
#parsed_script ⇒ ParsedRuby
The Ruby script contents parsed into a syntax tree.
-
#script ⇒ String
Returns the source for the script following the ‘-` marker.
Methods inherited from Node
#comment_configuration, #directives, #disabled?, #each, #initialize, #inspect, #line_numbers, #lines, #next_node, #predecessor, #source_code, #subsequents, #successor, #text
Constructor Details
This class inherits a constructor from HamlLint::Tree::Node
Instance Method Details
#parsed_script ⇒ ParsedRuby
The Ruby script contents parsed into a syntax tree.
9 10 11 |
# File 'lib/haml_lint/tree/script_node.rb', line 9 def parsed_script HamlLint::ParsedRuby.new(HamlLint::RubyParser.new.parse(script)) end |
#script ⇒ String
Returns the source for the script following the ‘-` marker.
16 17 18 |
# File 'lib/haml_lint/tree/script_node.rb', line 16 def script @value[:text] end |