Sha256: e1fa967e1be6bfdbb0e1ed0003295cabf18e77e5e3f974a2eb179c8302993f87

Contents?: true

Size: 690 Bytes

Versions: 2

Compression:

Stored size: 690 Bytes

Contents

# encoding: utf-8

module ViglinkApi
  module Product

    ##
    # Retrieve the list of Products
    # @param :full [Boolean] If set to true|y|yes then this will return 
    # the complete response
    #
    # @return [Hashie::Mash] Product
    def find_products(options={})
      full_response = options.delete(:full) if options[:full]
      options[:key] = @api_key
      products_response = get('/vigcatalog/products.xml', options)

      if full_response.to_s.to_bool or @api_full_response
        products_response.response if products_response.response
      else
        products_response.response.results.products if products_response.response.results
      end
    end

  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
viglink-api-0.1.1 lib/viglink_api/product.rb
viglink-api-0.1.0 lib/viglink_api/product.rb