Class: Tramway::Event::PartakingDecorator
- Inherits:
-
ApplicationDecorator
- Object
- ApplicationDecorator
- Tramway::Event::PartakingDecorator
- Defined in:
- app/decorators/tramway/event/partaking_decorator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.collections ⇒ Object
5 6 7 |
# File 'app/decorators/tramway/event/partaking_decorator.rb', line 5 def collections [:all] end |
.show_attributes ⇒ Object
9 10 11 |
# File 'app/decorators/tramway/event/partaking_decorator.rb', line 9 def show_attributes %i[part_name event_duration part_description] end |
Instance Method Details
#event_duration ⇒ Object
25 26 27 28 29 30 31 |
# File 'app/decorators/tramway/event/partaking_decorator.rb', line 25 def event_duration if part.respond_to? :duration part.duration else part.event.duration end end |
#name ⇒ Object
17 18 19 |
# File 'app/decorators/tramway/event/partaking_decorator.rb', line 17 def name "#{object.person.first_name} #{object.person.last_name} - #{object.position}" end |
#part_description ⇒ Object
33 34 35 |
# File 'app/decorators/tramway/event/partaking_decorator.rb', line 33 def part_description raw part.respond_to?(:description) ? part.description : part.event.description end |
#part_name ⇒ Object
21 22 23 |
# File 'app/decorators/tramway/event/partaking_decorator.rb', line 21 def part_name part.name end |