Class: ShopifyApp::ScripttagsManager
- Inherits:
-
Object
- Object
- ShopifyApp::ScripttagsManager
- Defined in:
- lib/shopify_app/scripttags_manager.rb
Defined Under Namespace
Classes: CreationFailed
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.queue(shop_domain, shop_token) ⇒ Object
5 6 7 |
# File 'lib/shopify_app/scripttags_manager.rb', line 5 def self.queue(shop_domain, shop_token) ShopifyApp::ScripttagsManagerJob.perform_later(shop_domain: shop_domain, shop_token: shop_token) end |
Instance Method Details
#create_scripttags ⇒ Object
14 15 16 17 18 19 20 |
# File 'lib/shopify_app/scripttags_manager.rb', line 14 def return unless .present? .each do |scripttag| create_scripttag(scripttag) unless scripttag_exists?(scripttag[:src]) end end |
#destroy_scripttags ⇒ Object
22 23 24 25 26 27 28 |
# File 'lib/shopify_app/scripttags_manager.rb', line 22 def ShopifyAPI::ScriptTag.all.each do |scripttag| ShopifyAPI::ScriptTag.delete(scripttag.id) if is_required_scripttag?(scripttag) end @current_scripttags = nil end |
#recreate_scripttags! ⇒ Object
9 10 11 12 |
# File 'lib/shopify_app/scripttags_manager.rb', line 9 def end |