Sha256: 6124ca0f77093974173e09f2159c462b96047e5714ff197b570ce30334638054

Contents?: true

Size: 931 Bytes

Versions: 10

Compression:

Stored size: 931 Bytes

Contents

# frozen_string_literal: true

class Tramway::Event::ParticipantXlsDecorator < Tramway::Export::Xls::ApplicationDecorator
  class << self
    def columns
      %i[full_name email phone organization event].map do |attribute|
        { Tramway::Event::Participant.human_attribute_name(attribute).to_sym => attribute }
      end
    end

    def filename
      'participants.xls'
    end
  end

  def full_name
    return unless object.values

    "#{object.values['Фамилия'] || object.values['Фамилия ']} #{object.values['Имя'] || object.values['Имя ']}"
  end

  def email
    return unless object.values

    object.values['Email']
  end

  def phone
    return unless object.values

    object.values['Телефон']
  end

  def organization
    return unless object.values

    object.values['Место работы/ Учебное заведение']
  end

  def event
    object.event.title
  end
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
tramway-event-1.10.1 app/decorators/tramway/event/participant_xls_decorator.rb
tramway-event-1.10.0.2 app/decorators/tramway/event/participant_xls_decorator.rb
tramway-event-1.10.0.1 app/decorators/tramway/event/participant_xls_decorator.rb
tramway-event-1.10 app/decorators/tramway/event/participant_xls_decorator.rb
tramway-event-1.9.31.2 app/decorators/tramway/event/participant_xls_decorator.rb
tramway-event-1.9.31.1 app/decorators/tramway/event/participant_xls_decorator.rb
tramway-event-1.9.31 app/decorators/tramway/event/participant_xls_decorator.rb
tramway-event-1.9.30 app/decorators/tramway/event/participant_xls_decorator.rb
tramway-event-1.9.29 app/decorators/tramway/event/participant_xls_decorator.rb
tramway-event-1.9.28.4 app/decorators/tramway/event/participant_xls_decorator.rb