Sha256: 865b5360eb628888f86bcd39cce5e56a54c3086356f62146e5997dd72ede0380

Contents?: true

Size: 531 Bytes

Versions: 26

Compression:

Stored size: 531 Bytes

Contents

module ShopifyAPI
  # Shop object. Use Shop.current to receive 
  # the shop.
  class Shop < Base
    def self.current(options={})
      find(:one, options.merge({from: "/admin/shop.#{format.extension}"}))
    end

    def metafields
      Metafield.find(:all)
    end
    
    def add_metafield(metafield)
      raise ArgumentError, "You can only add metafields to resource that has been saved" if new?      
      metafield.save
      metafield
    end
    
    def events
      Event.find(:all)
    end
  end               
end

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
shopify_api-4.7.0 lib/shopify_api/resources/shop.rb
shopify_api-4.6.0 lib/shopify_api/resources/shop.rb
shopify_api-4.5.0 lib/shopify_api/resources/shop.rb
shopify_api-4.4.0 lib/shopify_api/resources/shop.rb
shopify_api-4.3.9 lib/shopify_api/resources/shop.rb
shopify_api-4.3.8 lib/shopify_api/resources/shop.rb
shopify_api-4.3.7 lib/shopify_api/resources/shop.rb
shopify_api-4.3.6 lib/shopify_api/resources/shop.rb
shopify_api-4.3.5 lib/shopify_api/resources/shop.rb
shopify_api-4.3.4 lib/shopify_api/resources/shop.rb
shopify_api-4.3.3 lib/shopify_api/resources/shop.rb
shopify_api-4.3.2 lib/shopify_api/resources/shop.rb
shopify_api-4.3.1 lib/shopify_api/resources/shop.rb
shopify_api-4.3.0 lib/shopify_api/resources/shop.rb
shopify_api-4.2.2 lib/shopify_api/resources/shop.rb
shopify_api-4.2.1 lib/shopify_api/resources/shop.rb
shopify_api-4.2.0 lib/shopify_api/resources/shop.rb
shopify_api-4.1.1 lib/shopify_api/resources/shop.rb
shopify_api-4.1.0 lib/shopify_api/resources/shop.rb
shopify_api-4.0.7 lib/shopify_api/resources/shop.rb