Class: RuboCop::Cop::RSpecRails::HttpStatus::SymbolicStyleChecker

Inherits:
StyleCheckerBase
  • Object
show all
Defined in:
lib/rubocop/cop/rspec_rails/http_status.rb

Overview

:nodoc:

Constant Summary

Constants inherited from StyleCheckerBase

RuboCop::Cop::RSpecRails::HttpStatus::StyleCheckerBase::ALLOWED_STATUSES, RuboCop::Cop::RSpecRails::HttpStatus::StyleCheckerBase::MSG, RuboCop::Cop::RSpecRails::HttpStatus::StyleCheckerBase::MSG_UNKNOWN_STATUS_CODE

Instance Attribute Summary

Attributes inherited from StyleCheckerBase

#node

Instance Method Summary collapse

Methods inherited from StyleCheckerBase

#allowed_symbol?, #current, #custom_http_status_code?, #initialize, #message, #offense_range

Constructor Details

This class inherits a constructor from RuboCop::Cop::RSpecRails::HttpStatus::StyleCheckerBase

Instance Method Details

#autocorrectable?Boolean

Returns:

  • (Boolean)
[View source]

157
158
159
# File 'lib/rubocop/cop/rspec_rails/http_status.rb', line 157

def autocorrectable?
  !!symbol
end

#offensive?Boolean

Returns:

  • (Boolean)
[View source]

153
154
155
# File 'lib/rubocop/cop/rspec_rails/http_status.rb', line 153

def offensive?
  !node.sym_type? && !custom_http_status_code?
end

#preferObject

[View source]

161
162
163
# File 'lib/rubocop/cop/rspec_rails/http_status.rb', line 161

def prefer
  symbol.inspect
end