Class: RuboCop::Erb::RubyClipper::PrecedingKeywordRemover
- Inherits:
-
Object
- Object
- RuboCop::Erb::RubyClipper::PrecedingKeywordRemover
- Defined in:
- lib/rubocop/erb/ruby_clipper.rb
Overview
Remove preceding keyword.
Constant Summary collapse
- REGEXP =
/ \A \s* (?: begin | case | else | elsif | end | ensure | if | rescue | unless | until | when | while | for[ \t]+\w+[ \t]+in ) [ \t] /x.freeze
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Hash
-
#initialize(code) ⇒ PrecedingKeywordRemover
constructor
A new instance of PrecedingKeywordRemover.
Constructor Details
#initialize(code) ⇒ PrecedingKeywordRemover
Returns a new instance of PrecedingKeywordRemover.
71 72 73 |
# File 'lib/rubocop/erb/ruby_clipper.rb', line 71 def initialize(code) @code = code end |
Class Method Details
.call(code) ⇒ RubyClip
65 66 67 |
# File 'lib/rubocop/erb/ruby_clipper.rb', line 65 def call(code) new(code).call end |