countable.rb 255 B

123456789101112131415
  1. # frozen_string_literal: true
  2. module ShopifyAPI
  3. module Countable
  4. def count(options = {})
  5. data = get(:count, options)
  6. count = case data
  7. when Hash then data["count"]
  8. else data
  9. end
  10. Integer(count)
  11. end
  12. end
  13. end