Class: Tramway::SportSchool::DocumentDecorator

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

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.collectionsObject



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

def collections
  [:all]
end

.list_attributesObject



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

def list_attributes
  [:view_state]
end

.show_attributesObject



13
14
15
# File 'app/decorators/tramway/sport_school/document_decorator.rb', line 13

def show_attributes
  [:title]
end

Instance Method Details

#view_stateObject



22
23
24
# File 'app/decorators/tramway/sport_school/document_decorator.rb', line 22

def view_state
  object.human_view_state_name
end

#view_state_button_color(event) ⇒ Object



26
27
28
29
30
31
32
33
# File 'app/decorators/tramway/sport_school/document_decorator.rb', line 26

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