Class: Tramway::Event::PartakingDecorator
- Inherits:
-
Core::ApplicationDecorator
- Object
- Core::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
24 25 26 27 28 29 30 |
# File 'app/decorators/tramway/event/partaking_decorator.rb', line 24 def event_duration if part.respond_to? :duration part.duration else part.event.duration end end |
#name ⇒ Object
16 17 18 |
# File 'app/decorators/tramway/event/partaking_decorator.rb', line 16 def name "#{object.person.first_name} #{object.person.last_name} - #{object.position}" end |
#part_description ⇒ Object
32 33 34 |
# File 'app/decorators/tramway/event/partaking_decorator.rb', line 32 def part_description raw part.respond_to?(:description) ? part.description : part.event.description end |
#part_name ⇒ Object
20 21 22 |
# File 'app/decorators/tramway/event/partaking_decorator.rb', line 20 def part_name part.name end |