Class: ReviewReservationDecorator

Inherits:
Draper::Decorator
  • Object
show all
Defined in:
app/decorators/review_reservation_decorator.rb

Overview

Responsible to decorate ::Review instance to be used in Reservation Review feature

Constant Summary collapse

FIRST_STEP =

Review is not created yet

1.0
SECOND_STEP =

Review already created, but other attributes like occasion, etc is empty

2.0
SECOND_HALF_STEP =

Review and all attributes already created, but waiting guest to sign up

2.5
THIRD_STEP =

All done

3.0

Instance Method Summary collapse

Instance Method Details

#first_step?Boolean

Returns:

  • (Boolean)


20
21
22
# File 'app/decorators/review_reservation_decorator.rb', line 20

def first_step?
  state == 1.0
end

#second_half_step?Boolean

Returns:

  • (Boolean)


28
29
30
# File 'app/decorators/review_reservation_decorator.rb', line 28

def second_half_step?
  state == 2.5
end

#second_step?Boolean

Returns:

  • (Boolean)


24
25
26
# File 'app/decorators/review_reservation_decorator.rb', line 24

def second_step?
  state == 2.0
end

#third_step?Boolean Also known as: complete?

Returns:

  • (Boolean)


32
33
34
# File 'app/decorators/review_reservation_decorator.rb', line 32

def third_step?
  state == 3.0
end