Module: ShopifyAPI::Countable

Included in:
Base
Defined in:
lib/shopify_api/countable.rb

Instance Method Summary collapse

Instance Method Details

#count(options = {}) ⇒ Object



3
4
5
6
7
8
9
10
11
12
# File 'lib/shopify_api/countable.rb', line 3

def count(options = {})
  data = get(:count, options)

  count = case data
    when Hash then data["count"]
    else data
  end

  Integer(count)
end