Class: RubyCop::Ruby::When

Inherits:
ChainedBlock show all
Defined in:
lib/ruby_cop/ruby/case.rb

Instance Attribute Summary collapse

Attributes inherited from ChainedBlock

#blocks

Attributes inherited from Block

#params

Attributes inherited from List

#elements

Instance Method Summary collapse

Methods inherited from Statements

#to_block, #to_chained_block, #to_program

Methods inherited from List

#add

Methods inherited from Node

#accept

Constructor Details

#initialize(expression, statements, block = nil) ⇒ When

Returns a new instance of When.



14
15
16
17
# File 'lib/ruby_cop/ruby/case.rb', line 14

def initialize(expression, statements, block=nil)
  @expression = expression
  super([block], statements)
end

Instance Attribute Details

#expressionObject (readonly)

Returns the value of attribute expression.



19
20
21
# File 'lib/ruby_cop/ruby/case.rb', line 19

def expression
  @expression
end