Project

taxy

0.0
No commit activity in last 3 years
No release in over 3 years
Cabify API wrapper.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.15
~> 10.0
~> 3.0

Runtime

>= 0.9.0, ~> 0.9
~> 1.8
>= 1.0.5, ~> 1.0
 Project Readme

Taxy

Simple API wrapper for Cabify public API, built on top of Faraday. As of now, a bearer token is required beforehand

Installation

Add this line to your application's Gemfile, then execute bundle:

gem 'taxy'

Or install it yourself as:

$ gem install taxy

Usage

Taxy::Client.new(bearer_token: 123)
=> #<Taxy::Client:0x00000001ebe280 @bearer_token=123>
taxy = Taxy::Client.new(bearer_token: 123)
taxy.user # http://developers.cabify.com/#users
=> #<Taxy::User:0x00000001a31500
 @avatar_url="http://example.com/example.jpg",
 @email="johndoe@example.com",
 @locale="pt-BR",
 @mobile_cc="12",
 @mobile_num="123123123",
 @name="John",
 @surname="Doe">
taxy = Taxy::Client.new(bearer_token: 123) # http://developers.cabify.com/#estimates
taxy.estimate(starting_latitude: 1, starting_longitude: 1, ending_latitude: 1, ending_longitude: 1)
=> [#<Taxy::Estimation:0x00000002053eb0
  @currency="EUR",
  @currency_symbol="€",
  @price_formatted="12.34€",
  @total_price=1234,
  @vehicle_type=
   #<Taxy::Estimation::Vehicle:0x00000002053de8
    @_id="executive_id",
    @description="A very large vehicle with comfortable seats",
    @eta=#<Taxy::Estimation::Vehicle::Eta:0x00000002053780 @formatted=">2 min", @low_availability=nil, @max=1000, @min=100>,
    @icon="executive",
    @icons=#<Taxy::Estimation::Vehicle::Icons:0x00000002053988 @regular="https://cabify.com/images/icons/vehicle_type/executive_27.png">,
    @name="Executive Class",
    @short_name="Executive">>]

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Drowze/taxy.

License

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