Class: RuboCop::Erb::KeywordRemover::TrailingSourceRemover
- Inherits:
-
Object
- Object
- RuboCop::Erb::KeywordRemover::TrailingSourceRemover
- Defined in:
- lib/rubocop/erb/keyword_remover.rb
Direct Known Subclasses
TrailingBraceRemover, TrailingDoRemover, TrailingThenRemover
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Hash
-
#initialize(code) ⇒ TrailingSourceRemover
constructor
A new instance of TrailingSourceRemover.
Constructor Details
#initialize(code) ⇒ TrailingSourceRemover
Returns a new instance of TrailingSourceRemover.
112 113 114 |
# File 'lib/rubocop/erb/keyword_remover.rb', line 112 def initialize(code) @code = code end |
Class Method Details
.call(code) ⇒ RubyClip
106 107 108 |
# File 'lib/rubocop/erb/keyword_remover.rb', line 106 def call(code) new(code).call end |
Instance Method Details
#call ⇒ Hash
117 118 119 120 121 122 |
# File 'lib/rubocop/erb/keyword_remover.rb', line 117 def call RubyClip.new( code: @code.sub(self.class::REGEXP, ''), offset: 0 ) end |