Skip to content

Commit

Permalink
Update terminology in http_status.rb
Browse files Browse the repository at this point in the history
Use permitted where applicable
  • Loading branch information
Juanito Fatas authored and bbatsov committed Nov 12, 2018
1 parent 9968b0f commit 70bf1be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/rubocop/cop/rails/http_status.rb
Original file line number Diff line number Diff line change
Expand Up @@ -143,15 +143,15 @@ class NumericStyleChecker
'to define HTTP status code.'.freeze
DEFAULT_MSG = 'Prefer `numeric` over `symbolic` ' \
'to define HTTP status code.'.freeze
WHITELIST_STATUS = %i[error success missing redirect].freeze
PERMITTED_STATUS = %i[error success missing redirect].freeze

attr_reader :node
def initialize(node)
@node = node
end

def offensive?
!node.int_type? && !whitelisted_symbol?
!node.int_type? && !permitted_symbol?
end

def message
Expand All @@ -176,8 +176,8 @@ def symbol
node.value
end

def whitelisted_symbol?
node.sym_type? && WHITELIST_STATUS.include?(node.value)
def permitted_symbol?
node.sym_type? && PERMITTED_STATUS.include?(node.value)
end
end
end
Expand Down

0 comments on commit 70bf1be

Please sign in to comment.