Class: Workarea::Listrak::Models::CustomerForm

Inherits:
Object
  • Object
show all
Defined in:
app/services/workarea/listrak/models/customer_form.rb

Constant Summary collapse

GENDERS =
['M', 'F', 'Male', 'Female']

Instance Method Summary collapse

Constructor Details

#initialize(user) ⇒ CustomerForm

Returns a new instance of CustomerForm.

Parameters:

  • user (Workarea::User)

    to create a customer



9
10
11
# File 'app/services/workarea/listrak/models/customer_form.rb', line 9

def initialize(user)
  @user = user
end

Instance Method Details

#as_json(_options) ⇒ Object



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
# File 'app/services/workarea/listrak/models/customer_form.rb', line 13

def as_json(_options)
  {
    address: address,
    birthday: birthday,
    customerNumber: customer_number,
    email: email,
    firstName: first_name,
    gender: gender,
    homePhone: home_phone,
    lastName: last_name,
    meta1: meta1,
    meta2: meta2,
    meta3: meta3,
    meta4: meta4,
    meta5: meta5,
    mobilePhone: mobile_phone,
    preferredStoreNumber: preferred_store_number,
    registered: registered,
    workPhone: work_phone,
    zipCode: zip_code
  }.compact
end