Class: SpreeCmCommissioner::Organizer::ExportGuestCsvService
- Inherits:
-
Object
- Object
- SpreeCmCommissioner::Organizer::ExportGuestCsvService
- Defined in:
- app/services/spree_cm_commissioner/organizer/export_guest_csv_service.rb
Instance Attribute Summary collapse
-
#columns ⇒ Object
readonly
Returns the value of attribute columns.
-
#event_id ⇒ Object
readonly
Returns the value of attribute event_id.
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(event_id, columns) ⇒ ExportGuestCsvService
constructor
A new instance of ExportGuestCsvService.
Constructor Details
#initialize(event_id, columns) ⇒ ExportGuestCsvService
6 7 8 9 |
# File 'app/services/spree_cm_commissioner/organizer/export_guest_csv_service.rb', line 6 def initialize(event_id, columns) @event_id = event_id @columns = columns end |
Instance Attribute Details
#columns ⇒ Object (readonly)
Returns the value of attribute columns.
4 5 6 |
# File 'app/services/spree_cm_commissioner/organizer/export_guest_csv_service.rb', line 4 def columns @columns end |
#event_id ⇒ Object (readonly)
Returns the value of attribute event_id.
4 5 6 |
# File 'app/services/spree_cm_commissioner/organizer/export_guest_csv_service.rb', line 4 def event_id @event_id end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 |
# File 'app/services/spree_cm_commissioner/organizer/export_guest_csv_service.rb', line 11 def call CSV.generate(headers: true) do |csv| csv << headers guests_with_associations.each { |guest| csv << build_row(guest) } end end |