Sha256: 74942d2fbd731979cafdfa60bb27f352a66dfdaedd1cc23a2373ab74a2355c70

Contents?: true

Size: 509 Bytes

Versions: 21

Compression:

Stored size: 509 Bytes

Contents

module ShopifyAPI
  # Shop object. Use Shop.current to receive 
  # the shop.
  class Shop < Base
    def self.current
      find(:one, :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

21 entries across 21 versions & 2 rubygems

Version Path
shopify_api-3.2.5 lib/shopify_api/resources/shop.rb
shopify_api-3.2.4 lib/shopify_api/resources/shop.rb
shopify_api-3.2.3 lib/shopify_api/resources/shop.rb
shopify_api-3.2.2 lib/shopify_api/resources/shop.rb
shopify_api-3.2.1 lib/shopify_api/resources/shop.rb
shopify_api-3.2.0 lib/shopify_api/resources/shop.rb
shopify_api-3.1.8 lib/shopify_api/resources/shop.rb
shopify_api-3.1.7 lib/shopify_api/resources/shop.rb
shopify_api-3.1.6 lib/shopify_api/resources/shop.rb
shopify_api-3.1.5 lib/shopify_api/resources/shop.rb
shopify_api-3.1.3 lib/shopify_api/resources/shop.rb
shopify_api-3.1.2 lib/shopify_api/resources/shop.rb
shopify_api-3.0.3 lib/shopify_api/resources/shop.rb
shopify_api-3.0.2 lib/shopify_api/resources/shop.rb
shopify_api-3.0.1 lib/shopify_api/resources/shop.rb
shopify_api-3.0.0 lib/shopify_api/resources/shop.rb
shopify_api-2.3.0 lib/shopify_api/resources/shop.rb
shopify_api-2.2.0 lib/shopify_api/resources/shop.rb
shopify_api-2.1.0 lib/shopify_api/resources/shop.rb
shopify_api-2.0.0 lib/shopify_api/resources/shop.rb