Class: PartnerService::MenuSections::ExportMenuSectionsService

Inherits:
ApplicationService show all
Defined in:
app/services/partner_service/menu_sections/export_menu_sections_service.rb

Instance Attribute Summary collapse

Attributes inherited from ApplicationService

#object

Instance Method Summary collapse

Methods inherited from ApplicationService

#execute, #execute!

Constructor Details

#initialize(args) ⇒ ExportMenuSectionsService

Returns a new instance of ExportMenuSectionsService.



12
13
14
15
16
17
18
19
20
# File 'app/services/partner_service/menu_sections/export_menu_sections_service.rb', line 12

def initialize(args)
  I18n.locale = :en
  args.to_h.with_indifferent_access.each do |k, v|
    next if k.to_s == :use_long_process.to_s

    send("#{k}=".to_sym, v)
  end
  @menu_sections = collect_menu_sections
end

Instance Attribute Details

#dateObject

Returns the value of attribute date.



7
8
9
# File 'app/services/partner_service/menu_sections/export_menu_sections_service.rb', line 7

def date
  @date
end

#date_filter_typeObject

Returns the value of attribute date_filter_type.



7
8
9
# File 'app/services/partner_service/menu_sections/export_menu_sections_service.rb', line 7

def date_filter_type
  @date_filter_type
end

#date_fromObject

Returns the value of attribute date_from.



7
8
9
# File 'app/services/partner_service/menu_sections/export_menu_sections_service.rb', line 7

def date_from
  @date_from
end

#date_toObject

Returns the value of attribute date_to.



7
8
9
# File 'app/services/partner_service/menu_sections/export_menu_sections_service.rb', line 7

def date_to
  @date_to
end

Returns the value of attribute menu_items_ids.



7
8
9
# File 'app/services/partner_service/menu_sections/export_menu_sections_service.rb', line 7

def menu_items_ids
  @menu_items_ids
end

Returns the value of attribute menu_items_type.



7
8
9
# File 'app/services/partner_service/menu_sections/export_menu_sections_service.rb', line 7

def menu_items_type
  @menu_items_type
end

Returns the value of attribute menu_sections.



7
8
9
# File 'app/services/partner_service/menu_sections/export_menu_sections_service.rb', line 7

def menu_sections
  @menu_sections
end

#restaurant_idObject

Returns the value of attribute restaurant_id.



7
8
9
# File 'app/services/partner_service/menu_sections/export_menu_sections_service.rb', line 7

def restaurant_id
  @restaurant_id
end

Instance Method Details

#downloadObject



22
23
24
25
26
# File 'app/services/partner_service/menu_sections/export_menu_sections_service.rb', line 22

def download
  generate_menu_sections_report_to_restaurant
  self.attachment = store_to_attachment
  download_link
end