Class: RuboCop::Slim::KeywordRemover::PrecedingKeywordRemover
- Inherits:
-
Object
- Object
- RuboCop::Slim::KeywordRemover::PrecedingKeywordRemover
- Defined in:
- lib/rubocop/slim/keyword_remover.rb
Overview
Remove preceding keyword.
Constant Summary collapse
- REGEXP =
/ \A (?: begin | case | else | elsif | ensure | if | rescue | unless | until | when | while | for[ \t]+\w+[ \t]+in ) \b[ \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.
64 65 66 |
# File 'lib/rubocop/slim/keyword_remover.rb', line 64 def initialize(code) @code = code end |
Class Method Details
.call(code) ⇒ RubyClip
58 59 60 |
# File 'lib/rubocop/slim/keyword_remover.rb', line 58 def call(code) new(code).call end |