Class: ShopCustomer

Inherits:
User
  • Object
show all
Includes:
Users::Models::User::Scoped
Defined in:
app/models/shop_customer.rb

Instance Method Summary collapse

Instance Method Details

#first_nameObject



5
6
7
8
9
10
11
12
13
14
15
16
# File 'app/models/shop_customer.rb', line 5

def first_name
  name = ''
  
  names = self.name.split(' ')
  if names.length > 1
    name = names[0, names.length-1].join(' ') 
  else
    name = names.join(' ')
  end
  
  name
end

#last_nameObject



18
19
20
21
22
23
24
25
26
27
# File 'app/models/shop_customer.rb', line 18

def last_name
  name = ''
  
  names = self.name.split(' ')
  if names.length > 1
    name = names[-1]
  end
  
  name
end