Class: RailsBestPractices::Core::Error
- Inherits:
-
CodeAnalyzer::Warning
- Object
- CodeAnalyzer::Warning
- RailsBestPractices::Core::Error
- Defined in:
- lib/rails_best_practices/core/error.rb
Overview
Error is the violation to rails best practice.
it indicates the filenname, line number and error message for the violation.
Instance Attribute Summary collapse
-
#git_commit ⇒ Object
Returns the value of attribute git_commit.
-
#git_username ⇒ Object
Returns the value of attribute git_username.
-
#hg_commit ⇒ Object
Returns the value of attribute hg_commit.
-
#hg_username ⇒ Object
Returns the value of attribute hg_username.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #first_line_number ⇒ Object
-
#initialize(options = {}) ⇒ Error
constructor
A new instance of Error.
- #short_filename ⇒ Object
Constructor Details
#initialize(options = {}) ⇒ Error
Returns a new instance of Error.
12 13 14 15 16 17 18 19 20 |
# File 'lib/rails_best_practices/core/error.rb', line 12 def initialize( = {}) super @type = [:type] @url = [:url] @git_commit = [:git_commit] @git_username = [:git_username] @hg_commit = [:hg_commit] @hg_username = [:hg_username] end |
Instance Attribute Details
#git_commit ⇒ Object
Returns the value of attribute git_commit.
10 11 12 |
# File 'lib/rails_best_practices/core/error.rb', line 10 def git_commit @git_commit end |
#git_username ⇒ Object
Returns the value of attribute git_username.
10 11 12 |
# File 'lib/rails_best_practices/core/error.rb', line 10 def git_username @git_username end |
#hg_commit ⇒ Object
Returns the value of attribute hg_commit.
10 11 12 |
# File 'lib/rails_best_practices/core/error.rb', line 10 def hg_commit @hg_commit end |
#hg_username ⇒ Object
Returns the value of attribute hg_username.
10 11 12 |
# File 'lib/rails_best_practices/core/error.rb', line 10 def hg_username @hg_username end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
9 10 11 |
# File 'lib/rails_best_practices/core/error.rb', line 9 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
9 10 11 |
# File 'lib/rails_best_practices/core/error.rb', line 9 def url @url end |
Instance Method Details
#first_line_number ⇒ Object
26 27 28 |
# File 'lib/rails_best_practices/core/error.rb', line 26 def first_line_number line_number.split(',').first end |