Module: RuboCop::Cop::Helpers
- Included in:
- Obsession::Graphql::MutationName, Obsession::MethodOrder, Obsession::Rails::CallbackOneMethod, Obsession::Rails::PrivateCallback, Obsession::Rails::ServiceName
- Defined in:
- lib/rubocop/cop/mixin/helpers.rb
Constant Summary collapse
- VERBS =
File.read("#{__dir__}/files/verbs.txt").split
Instance Method Summary collapse
Instance Method Details
#rails_callback?(callback) ⇒ Boolean
8 9 10 11 12 13 14 15 16 17 18 |
# File 'lib/rubocop/cop/mixin/helpers.rb', line 8 def rails_callback?(callback) return true if callback == 'validate' callback.match?( / ^(before|after|around) _.* (action|validation|create|update|save|destroy|commit|rollback)$ /x ) end |