Project

bluepark

0.0
No commit activity in last 3 years
No release in over 3 years
A simple client created to help with Bluepark integration
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.15.1
>= 0
~> 12.0.0
>= 0
>= 0

Runtime

~> 3.3.1
~> 2.0.2
 Project Readme

Gem Version

Bluepark Ruby Gem

Installation

Add this line to your application's Gemfile:

gem 'bluepark'

And then execute:

$ bundle

Or install it yourself as:

$ gem install bluepark

Usage

For full understaning check out Bluepark Api Specification.

Initialize your client:

client = Bluepark.client(user_name: 'test_user', bluepark_api_uri: 'http://yourshop.betapark.co.uk/api/v1/', bluepark_token: 'abcabcabc')

To work with products:

client.products # returns Bluepark::Client::Products object to perform any operations  on products

Like:

client.products.get_products
client.products.get_product(id)

For full listing of methods check Products methods

To work with orders:

client.orders # returns Bluepark::Client::Orders object to perform operations on orders

Like:

client.orders.get_orders
client.orders.get_order(id)

For full listing of methods check Orders methods. Full listing of all classes and methods is available here: Rubydoc

Exception handling

Gem throws BlueparkException like this:

BlueparkError: {"status":"not_found","status_code":404,"error":{"code":404,"phrase":"Not Found","message":"Resource not found"}}

Possible variants for status and status_code are:

200 => 'success',
304 => 'not_modified',
400 => 'bad_request',
401 => 'unauthorized',
403 => 'forbidden',
404 => 'not_found',
405 => 'method_not_allowed',
406 => 'not_acceptable',
413 => 'too_large_request',
415 => 'unsupported_mediatype',
429 => 'too_many_requests',
500 => 'internal_server_error'

error is an error returned from Bluepark Api

License

The gem is available as open source under the terms of the MIT License.