Sha256: 36147cd14d323202f18214ed9adc8ae2532f3bba00d786b994805068e7589ca9

Contents?: true

Size: 535 Bytes

Versions: 12

Compression:

Stored size: 535 Bytes

Contents

module ShopifyAPI
  class Customer < Base
    include Metafields

    def orders
      Order.find(:all, params: {customer_id: self.id})
    end

    def self.search(params)
      find(:all, from: :search, params: params)
    end

    def account_activation_url
      resource = post(:account_activation_url, {}, only_id)
      data = ActiveSupport::JSON.decode(resource.body.to_s)
      result = nil

      if data.key?('account_activation_url')
        result = data['account_activation_url']
      end
      result
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
shopify_api-4.3.9 lib/shopify_api/resources/customer.rb
shopify_api-4.3.8 lib/shopify_api/resources/customer.rb
shopify_api-4.3.7 lib/shopify_api/resources/customer.rb
shopify_api-4.3.6 lib/shopify_api/resources/customer.rb
shopify_api-4.3.5 lib/shopify_api/resources/customer.rb
shopify_api-4.3.4 lib/shopify_api/resources/customer.rb
shopify_api-4.3.3 lib/shopify_api/resources/customer.rb
shopify_api-4.3.2 lib/shopify_api/resources/customer.rb
shopify_api-4.3.1 lib/shopify_api/resources/customer.rb
shopify_api-4.3.0 lib/shopify_api/resources/customer.rb
shopify_api-4.2.2 lib/shopify_api/resources/customer.rb
shopify_api-4.2.1 lib/shopify_api/resources/customer.rb