Ruby client for Yandex Metrica API
Installation
Add this line to your application's Gemfile:
gem 'metrica_api', '~> 0.1.0'
Or install from command line:
$ gem install metrica_api
Usage
# You need an access token to use API
api = MetricaApi.counters(token)
api.data(field: 'goals') # => { 'counters' => [...], ... }
Exceptions
def read_counters
MetricaApi.counters(token).data
rescue MetricaApi::RequestError, MetricaApi::ConnectionError => e
puts e.message, e.backtrace
end
Testing
bundle exec rspec
Contributing
Create a pull-request or make an issue