Module: Workarea::Storefront::SharesHelper

Defined in:
app/helpers/workarea/storefront/shares_helper.rb

Instance Method Summary collapse

Instance Method Details

#facebook_query_string(url) ⇒ Object



8
9
10
# File 'app/helpers/workarea/storefront/shares_helper.rb', line 8

def facebook_query_string(url)
  hash_without_blanks_to_query(u: url)
end

#share_analytics_data(type, url) ⇒ Object



24
25
26
27
28
29
30
# File 'app/helpers/workarea/storefront/shares_helper.rb', line 24

def share_analytics_data(type, url)
  {
    event: 'share',
    domEvent: 'click',
    payload: { type: type, url: url }
  }
end

#share_product_url(product, options = {}) ⇒ Object



4
5
6
# File 'app/helpers/workarea/storefront/shares_helper.rb', line 4

def share_product_url(product, options = {})
  product_url(product, options.merge(host: Workarea.config.host))
end

#share_query_string(url, message = nil, image = nil) ⇒ Object



16
17
18
19
20
21
22
# File 'app/helpers/workarea/storefront/shares_helper.rb', line 16

def share_query_string(url, message = nil, image = nil)
  hash_without_blanks_to_query(
    url: url,
    description: message,
    media: image
  )
end

#twitter_query_string(url, message = nil) ⇒ Object



12
13
14
# File 'app/helpers/workarea/storefront/shares_helper.rb', line 12

def twitter_query_string(url, message = nil)
  hash_without_blanks_to_query(url: url, text: message)
end