Class: Nitpick::Warnings::UnusedVariable
- Inherits:
-
SimpleWarning
- Object
- SimpleWarning
- Nitpick::Warnings::UnusedVariable
- Defined in:
- lib/nitpick/warnings/unused_variable.rb
Instance Attribute Summary collapse
-
#variable ⇒ Object
readonly
Returns the value of attribute variable.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(variable) ⇒ UnusedVariable
constructor
A new instance of UnusedVariable.
- #message ⇒ Object
Methods inherited from SimpleWarning
Constructor Details
#initialize(variable) ⇒ UnusedVariable
Returns a new instance of UnusedVariable.
6 7 8 |
# File 'lib/nitpick/warnings/unused_variable.rb', line 6 def initialize(variable) @variable = variable end |
Instance Attribute Details
#variable ⇒ Object (readonly)
Returns the value of attribute variable.
4 5 6 |
# File 'lib/nitpick/warnings/unused_variable.rb', line 4 def variable @variable end |
Instance Method Details
#==(other) ⇒ Object
10 11 12 |
# File 'lib/nitpick/warnings/unused_variable.rb', line 10 def ==(other) other.is_a?(self.class) && @variable == other.variable end |
#message ⇒ Object
14 15 16 |
# File 'lib/nitpick/warnings/unused_variable.rb', line 14 def "The variable #{@variable.inspect} is unused." end |