Project

buyon_api

0.0
No commit activity in last 3 years
No release in over 3 years
ruby gem for buyou api
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.10
~> 10.0
>= 0

Runtime

~> 0.9.2
 Project Readme

BuyonApi

Ruby gem for Buyon API (http://docs.buyon.ru/api).

Installation

Add this line to your application's Gemfile:

gem 'buyon_api'

And then execute:

$ bundle

Or install it yourself as:

$ gem install buyon_api

Usage

Configure gem credentials

 BuyonApi.configure do |config|
    config.login = ENV['BUYON_LOGIN']
    config.password = ENV['BUYON_PASSWORD']
 end

Make request

  conn = BuyonApi::Client.new
  result = conn.login(password: "password", login: "test@mail.ru")
  # => #<OpenStruct token="2bc053b4ce789df89casdasdeq2dqwd">
  result.toke
  # => "2bc053b4ce789df89casdasdeq2dqwd"
  result[:token]
  # => "2bc053b4ce789df89casdasdeq2dqwd"
  subscribe = conn.subscribe(token: result.token, email: "test@buyon.ru")
  # => #<OpenStruct success=true>
  subscribe.to_h
  # => {:success=>true}

License

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