Class: Tramway::SportSchool::TrainerDecorator
- Inherits:
-
Core::ApplicationDecorator
- Object
- Core::ApplicationDecorator
- Tramway::SportSchool::TrainerDecorator
- Defined in:
- app/decorators/tramway/sport_school/trainer_decorator.rb
Class Method Summary collapse
Instance Method Summary collapse
- #full_name ⇒ Object (also: #title)
- #initial_short_name ⇒ Object
- #view_state ⇒ Object
- #view_state_button_color(event) ⇒ Object
Class Method Details
.collections ⇒ Object
5 6 7 |
# File 'app/decorators/tramway/sport_school/trainer_decorator.rb', line 5 def collections [:all] end |
.list_attributes ⇒ Object
9 10 11 |
# File 'app/decorators/tramway/sport_school/trainer_decorator.rb', line 9 def list_attributes [:view_state] end |
Instance Method Details
#full_name ⇒ Object Also known as: title
14 15 16 |
# File 'app/decorators/tramway/sport_school/trainer_decorator.rb', line 14 def full_name "#{object.first_name} #{object.patronymic} #{object.last_name}" end |
#initial_short_name ⇒ Object
18 19 20 |
# File 'app/decorators/tramway/sport_school/trainer_decorator.rb', line 18 def initial_short_name "#{object.last_name} #{object.first_name[0]}. #{object.patronymic[0]}." end |
#view_state ⇒ Object
26 27 28 |
# File 'app/decorators/tramway/sport_school/trainer_decorator.rb', line 26 def view_state object.human_view_state_name end |
#view_state_button_color(event) ⇒ Object
30 31 32 33 34 35 36 37 |
# File 'app/decorators/tramway/sport_school/trainer_decorator.rb', line 30 def (event) case event when :publish :primary when :hide :secondary end end |