Class: Tramway::SportSchool::KindSportDecorator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.collectionsObject



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

def collections
  %i[all published hidden]
end

.list_attributesObject



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

def list_attributes
  [:view_state]
end

Instance Method Details

#view_stateObject



14
15
16
# File 'app/decorators/tramway/sport_school/kind_sport_decorator.rb', line 14

def view_state
  object.human_view_state_name
end

#view_state_button_color(event) ⇒ Object



18
19
20
21
22
23
24
25
# File 'app/decorators/tramway/sport_school/kind_sport_decorator.rb', line 18

def view_state_button_color(event)
  case event
  when :publish
    :primary
  when :hide
    :secondary
  end
end