Class: RubyCop::Ruby::If
- Inherits:
-
ChainedBlock
- Object
- Node
- List
- Statements
- Block
- ChainedBlock
- RubyCop::Ruby::If
- Defined in:
- lib/ruby_cop/ruby/if.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#expression ⇒ Object
readonly
Returns the value of attribute expression.
Attributes inherited from ChainedBlock
Attributes inherited from Block
Attributes inherited from List
Instance Method Summary collapse
-
#initialize(expression, statements = nil, else_block = nil) ⇒ If
constructor
A new instance of If.
Methods inherited from Statements
#to_block, #to_chained_block, #to_program
Methods inherited from List
Methods inherited from Node
Constructor Details
#initialize(expression, statements = nil, else_block = nil) ⇒ If
Returns a new instance of If.
4 5 6 7 |
# File 'lib/ruby_cop/ruby/if.rb', line 4 def initialize(expression, statements=nil, else_block=nil) @expression = expression super([else_block], statements, nil) end |
Instance Attribute Details
#expression ⇒ Object (readonly)
Returns the value of attribute expression.
8 9 10 |
# File 'lib/ruby_cop/ruby/if.rb', line 8 def expression @expression end |