Class: Phlexing::ERBTransformer
- Inherits:
-
Object
- Object
- Phlexing::ERBTransformer
- Defined in:
- lib/phlexing/erb_transformer.rb
Overview
Takes ERB and transforms it to Nokogiri-compatible HTML.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(source) ⇒ ERBTransformer
constructor
A new instance of ERBTransformer.
Constructor Details
#initialize(source) ⇒ ERBTransformer
Returns a new instance of ERBTransformer.
12 13 14 |
# File 'lib/phlexing/erb_transformer.rb', line 12 def initialize(source) @source = source.to_s.dup end |
Class Method Details
.call ⇒ Object
8 9 10 |
# File 'lib/phlexing/erb_transformer.rb', line 8 def self.call(...) new(...).call end |
Instance Method Details
#call ⇒ Object
16 17 18 19 20 21 22 23 |
# File 'lib/phlexing/erb_transformer.rb', line 16 def call remove_newlines strip_whitespace @source end |