Class: CaseWhenUser

Inherits:
ApplicationController show all
Defined in:
lib/spec/virtualizees/case_when_user.rb

Instance Method Summary collapse

Constructor Details

#initialize(value) ⇒ CaseWhenUser

Returns a new instance of CaseWhenUser.



2
3
4
# File 'lib/spec/virtualizees/case_when_user.rb', line 2

def initialize(value)
  @value = value
end

Instance Method Details

#describe_valueObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/spec/virtualizees/case_when_user.rb', line 6

def describe_value
  case @value
    when 1
      :one
    when 3..5
      :three_to_five
    when 7, 9
      :seven_or_nine
    when value * 10 < 90
      :passes_multiplication_test
    else
      :something_else
  end
end