Class: Tramway::User::UserDecorator

Inherits:
Core::ApplicationDecorator
  • Object
show all
Defined in:
app/decorators/tramway/user/user_decorator.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.collectionsObject



5
6
7
# File 'app/decorators/tramway/user/user_decorator.rb', line 5

def collections
  [:all]
end

.list_attributesObject



9
10
11
# File 'app/decorators/tramway/user/user_decorator.rb', line 9

def list_attributes
  [:email]
end

.show_attributesObject



13
14
15
# File 'app/decorators/tramway/user/user_decorator.rb', line 13

def show_attributes
  %i[email first_name last_name phone role created_at updated_at]
end

Instance Method Details

#nameObject Also known as: title



28
29
30
# File 'app/decorators/tramway/user/user_decorator.rb', line 28

def name
  "#{object&.first_name} #{object&.last_name}"
end

#show_associationsObject



18
19
20
# File 'app/decorators/tramway/user/user_decorator.rb', line 18

def show_associations
  [:social_networks]
end