Class: Tramway::User::UserDecorator
- Inherits:
-
Core::ApplicationDecorator
- Object
- Core::ApplicationDecorator
- Tramway::User::UserDecorator
- Defined in:
- app/decorators/tramway/user/user_decorator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #name ⇒ Object (also: #title)
- #show_associations ⇒ Object
Class Method Details
.collections ⇒ Object
5 6 7 |
# File 'app/decorators/tramway/user/user_decorator.rb', line 5 def collections [:all] end |
.list_attributes ⇒ Object
9 10 11 |
# File 'app/decorators/tramway/user/user_decorator.rb', line 9 def list_attributes [:email] end |
.show_attributes ⇒ Object
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
#name ⇒ Object 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_associations ⇒ Object
18 19 20 |
# File 'app/decorators/tramway/user/user_decorator.rb', line 18 def show_associations [:social_networks] end |