Class: Slim::Filter Private
- Inherits:
-
Temple::Filter
- Object
- Temple::Filter
- Slim::Filter
- Defined in:
- lib/slim/filter.rb
Overview
This class is part of a private API. You should avoid using this class if possible, as it may be removed or be changed in the future.
Base class for Temple filters used in Slim
Direct Known Subclasses
Compiler, EmbeddedEngine, EndInserter, Interpolation, Sections
Instance Method Summary collapse
- #on_slim_attrs(*attrs) ⇒ Object private
- #on_slim_comment(content) ⇒ Object private
- #on_slim_control(code, content) ⇒ Object private
- #on_slim_output(code, escape, content) ⇒ Object private
- #on_slim_tag(name, attrs, closed, content) ⇒ Object private
-
#tmp_var(prefix) ⇒ String
private
Generate unique temporary variable name.
Instance Method Details
#on_slim_attrs(*attrs) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
24 25 26 |
# File 'lib/slim/filter.rb', line 24 def on_slim_attrs(*attrs) [:slim, :attrs, *attrs.map {|k, v| [k, compile!(v)] }] end |
#on_slim_comment(content) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
12 13 14 |
# File 'lib/slim/filter.rb', line 12 def on_slim_comment(content) [:slim, :comment, compile!(content)] end |
#on_slim_control(code, content) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
8 9 10 |
# File 'lib/slim/filter.rb', line 8 def on_slim_control(code, content) [:slim, :control, code, compile!(content)] end |
#on_slim_output(code, escape, content) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
16 17 18 |
# File 'lib/slim/filter.rb', line 16 def on_slim_output(code, escape, content) [:slim, :output, code, escape, compile!(content)] end |
#on_slim_tag(name, attrs, closed, content) ⇒ Object
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
20 21 22 |
# File 'lib/slim/filter.rb', line 20 def on_slim_tag(name, attrs, closed, content) [:slim, :tag, name, compile!(attrs), closed, compile!(content)] end |
#tmp_var(prefix) ⇒ String
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Generate unique temporary variable name
31 32 33 34 |
# File 'lib/slim/filter.rb', line 31 def tmp_var(prefix) @tmp_var ||= 0 "_slim#{prefix}#{@tmp_var += 1}" end |