Class: Templatecop::RubyClipper::TrailingDoRemover
- Inherits:
-
Object
- Object
- Templatecop::RubyClipper::TrailingDoRemover
- Defined in:
- lib/templatecop/ruby_clipper.rb
Constant Summary collapse
- REGEXP =
/ [ \t] do [ \t]* (\|[^|]*\|)? [ \t]* \Z /x.freeze
Instance Method Summary collapse
- #call ⇒ Hash
-
#initialize(code) ⇒ TrailingDoRemover
constructor
A new instance of TrailingDoRemover.
Constructor Details
#initialize(code) ⇒ TrailingDoRemover
Returns a new instance of TrailingDoRemover.
80 81 82 |
# File 'lib/templatecop/ruby_clipper.rb', line 80 def initialize(code) @code = code end |
Instance Method Details
#call ⇒ Hash
85 86 87 88 89 90 |
# File 'lib/templatecop/ruby_clipper.rb', line 85 def call { code: @code.sub(REGEXP, ''), offset: 0 } end |