Class: Feed::ItemPresenter
Instance Attribute Summary
#current_account, #options, #url_helper
Instance Method Summary
collapse
#can?, #capture, #concat, #content_tag, #fa_icon, #h, #initialize, #link_to, #number_to_currency, #present, presents, #r, #safe_present, #simple_format, #u
Constructor Details
This class inherits a constructor from BasePresenter
Instance Method Details
#all_images ⇒ Object
9
10
11
|
# File 'app/services/feed/item_presenter.rb', line 9
def all_images
r.image_profiles.website_image_profiles_excluding_card.image_order.includes(:image).map(&:image)
end
|
#catalog_items ⇒ Object
21
22
23
|
# File 'app/services/feed/item_presenter.rb', line 21
def catalog_items
r.catalog_items.available_for_edi_feeds
end
|
#google_product_category_id ⇒ Object
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
# File 'app/services/feed/item_presenter.rb', line 25
def google_product_category_id
slt = primary_product_line&.slug_ltree.to_s
pc_url = product_category&.url
return 1897 if pc_url =~ /thermostats/ return 1519 if pc_url =~ /controls/ || slt.start_with?('floor_heating.control.integration') return 2729 if slt.start_with?('countertop_heater') && pc_url =~ /heating-elements/ return 499873 if slt.start_with?('floor_heating') return 595 if slt.start_with?('led_mirror', 'mirror_defogger') return 2060 if slt.start_with?('radiant_panel') return 4544 if slt.start_with?('roof_gutter_deicing') return 5362 if slt.start_with?('snow_melting') return 586 if slt.start_with?('towel_warmer') return 122 if pc_url =~ /insulation/ return 115 end
|
#public_specifications ⇒ Object
17
18
19
|
# File 'app/services/feed/item_presenter.rb', line 17
def public_specifications
r.rendered_product_specifications.select{|k,v| v[:visibility] != 'private' }
end
|
#seo_keywords ⇒ Object
5
6
7
|
# File 'app/services/feed/item_presenter.rb', line 5
def seo_keywords
r.seo_keywords.presence || product_line_page_keywords(r.primary_product_line)
end
|
#videos ⇒ Object
13
14
15
|
# File 'app/services/feed/item_presenter.rb', line 13
def videos
Item::VideoRetriever.new(tags: 'for-product-page').process(item).all_videos
end
|