Class: Tramway::SportSchool::TrainerDecorator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.collectionsObject



5
6
7
# File 'app/decorators/tramway/sport_school/trainer_decorator.rb', line 5

def collections
  [:all]
end

.list_attributesObject



9
10
11
# File 'app/decorators/tramway/sport_school/trainer_decorator.rb', line 9

def list_attributes
  [:view_state]
end

Instance Method Details

#full_nameObject 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_nameObject



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_stateObject



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 view_state_button_color(event)
  case event
  when :publish
    :primary
  when :hide
    :secondary
  end
end