Module: LoyaltyProgram::Benefits::ReferralPoints
- Included in:
- RewardWorkers::UserReferralReward
- Defined in:
- app/my_lib/loyalty_program/benefits/referral_points.rb
Instance Method Summary collapse
Instance Method Details
#referral_points(user, country_code = nil) ⇒ Object
2 3 4 5 6 7 8 9 10 11 12 13 14 |
# File 'app/my_lib/loyalty_program/benefits/referral_points.rb', line 2 def referral_points(user, country_code = nil) user_loyalty = user.user_loyalty method_name = if country_code.present? && country_code == ApiV5::Constants::COUNTRY_CODE_SG 'referral_point_sg' elsif country_code.present? && country_code == ApiV5::Constants::COUNTRY_CODE_MY 'referral_point_my' else 'referral_point_th' end user_loyalty.benefit_value(method_name, cast: :to_i) end |