Class: RuboCop::Cop::Ezcater::FeatureFlagActive
- Inherits:
-
RuboCop::Cop
- Object
- RuboCop::Cop
- RuboCop::Cop::Ezcater::FeatureFlagActive
- Defined in:
- lib/rubocop/cop/ezcater/feature_flag_active.rb
Overview
Use ‘EzcaterFeatureFlag.active?` with a tracking_id or array of identifiers
Constant Summary collapse
- MSG =
"`EzFF.active?` must be called with at least one of `tracking_id` or `identifiers`"
- FIRST_PARAM_MSG =
"The first argument to `EzFF.active?` must be a string literal or a variable " \ "or constant assigned to a string"
Instance Method Summary collapse
Instance Method Details
#on_send(node) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 |
# File 'lib/rubocop/cop/ezcater/feature_flag_active.rb', line 56 def on_send(node) return unless method_call_matcher(node) if first_param_bad(node) add_offense(node, location: :expression, message: FIRST_PARAM_MSG) end if ezff_active_one_arg(node) || !args_matcher(node) add_offense(node, location: :expression, message: MSG) end end |