Class: Tramway::Event::ParticipantXlsDecorator
- Inherits:
-
Tramway::Export::Xls::ApplicationDecorator
- Object
- Tramway::Export::Xls::ApplicationDecorator
- Tramway::Event::ParticipantXlsDecorator
- Defined in:
- app/decorators/tramway/event/participant_xls_decorator.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.columns ⇒ Object
5 6 7 8 9 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 5 def columns i[full_name email phone organization event].map do |attribute| { Tramway::Event::Participant.human_attribute_name(attribute).to_sym => attribute } end end |
.filename ⇒ Object
11 12 13 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 11 def filename 'participants.xls' end |
Instance Method Details
#email ⇒ Object
22 23 24 25 26 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 22 def email return unless object.values object.values['Email'] end |
#event ⇒ Object
40 41 42 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 40 def event object.event.title end |
#full_name ⇒ Object
16 17 18 19 20 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 16 def full_name return unless object.values "#{object.values['Фамилия'] || object.values['Фамилия ']} #{object.values['Имя'] || object.values['Имя ']}" end |
#organization ⇒ Object
34 35 36 37 38 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 34 def organization return unless object.values object.values['Место работы/ Учебное заведение'] end |
#phone ⇒ Object
28 29 30 31 32 |
# File 'app/decorators/tramway/event/participant_xls_decorator.rb', line 28 def phone return unless object.values object.values['Телефон'] end |