Class: SyntaxTree::Haml::Format::Formatter
- Inherits:
-
Formatter
- Object
- Formatter
- SyntaxTree::Haml::Format::Formatter
- Defined in:
- lib/syntax_tree/haml/format.rb
Instance Attribute Summary collapse
-
#literal_lines ⇒ Object
readonly
Returns the value of attribute literal_lines.
Instance Method Summary collapse
-
#initialize(source, *rest, options: ::SyntaxTree::Formatter::Options.new) ⇒ Formatter
constructor
A new instance of Formatter.
Constructor Details
#initialize(source, *rest, options: ::SyntaxTree::Formatter::Options.new) ⇒ Formatter
Returns a new instance of Formatter.
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/syntax_tree/haml/format.rb', line 9 def initialize( source, *rest, options: ::SyntaxTree::Formatter::Options.new ) @literal_lines = {} source .lines .each .with_index(1) do |line, index| @literal_lines[index] = line.rstrip if line.start_with?("!") end super(source, *rest, options: ) end |
Instance Attribute Details
#literal_lines ⇒ Object (readonly)
Returns the value of attribute literal_lines.
7 8 9 |
# File 'lib/syntax_tree/haml/format.rb', line 7 def literal_lines @literal_lines end |