Class: ReviewCpt::Cell::LandingPage

Inherits:
FirstStep
  • Object
show all
Defined in:
app/concepts/review_cpt/cell/landing_page.rb

Overview

typed: ignore frozen_string_literal: true

Instance Method Summary collapse

Instance Method Details

#customer?Boolean

Returns:

  • (Boolean)


25
26
27
# File 'app/concepts/review_cpt/cell/landing_page.rb', line 25

def customer?
  !member?
end

#earned_review_pointsObject



13
14
15
16
17
18
19
20
21
22
23
# File 'app/concepts/review_cpt/cell/landing_page.rb', line 13

def earned_review_points
  # minimum review with photos is 3 photos
  is_review_with_photos = options[:reservation].review.review_photos_count >= 3

  country_code = options[:reservation].restaurant.country.alpha3
  LoyaltyLevel.review_points(
    options[:reservation].user,
    is_review_with_photos: is_review_with_photos,
    country_code: country_code,
  )
end

#member?Boolean

Returns:

  • (Boolean)


5
6
7
# File 'app/concepts/review_cpt/cell/landing_page.rb', line 5

def member?
  (options[:customer] || options['customer']) == 'member'
end

#only_thai_member?Boolean

Returns:

  • (Boolean)


9
10
11
# File 'app/concepts/review_cpt/cell/landing_page.rb', line 9

def only_thai_member?
  options[:reservation].restaurant.eligible_for_rewards?
end