Class: SpreeCmCommissioner::Users::IncompleteGuestCheckerService

Inherits:
Object
  • Object
show all
Defined in:
app/services/spree_cm_commissioner/users/incomplete_guest_checker_service.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ IncompleteGuestCheckerService



6
7
8
# File 'app/services/spree_cm_commissioner/users/incomplete_guest_checker_service.rb', line 6

def initialize(user)
  @user = user
end

Instance Attribute Details

#userObject (readonly)

Returns the value of attribute user.



4
5
6
# File 'app/services/spree_cm_commissioner/users/incomplete_guest_checker_service.rb', line 4

def user
  @user
end

Instance Method Details

#callObject



10
11
12
13
14
15
# File 'app/services/spree_cm_commissioner/users/incomplete_guest_checker_service.rb', line 10

def call
  return if user.blank? || incomplete_guest_info?

  user.['has_incomplete_guest_info'] = false
  user.save!
end