Crema API Ruby Client
Installation
Add this line to your application's Gemfile:
gem 'crema-api-ruby-client'
And then execute:
$ bundle
Add your credentials to config/initializers/crema.rb
:
require 'crema'
Crema.configure do |config|
config.app_id = ENV['CREMA_APP_ID']
config.secret = ENV['CREMA_SECRET']
end
Crema.config.access_token = Crema::OAuth.token
Usage
client = Crema::Client.new
products = client.fetch_products(brand_id: 108, limit: 3)
products.each do |product|
puts product.id
puts product.image_url
puts product.name
puts product.final_price
end
product = client.fetch_product(466033, brand_id: 108)
puts product.url
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/ahastudio/crema-api-ruby-client.