No commit activity in last 3 years
No release in over 3 years
Write a longer description or delete this line.
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

 Project Readme

LOLCATION CLIENT

Build Status RubyGems Code Climate RubyGems

A Rails GEM to use Lolcation Service.

Getting started

Add to your Gemfile:

gem 'lolcation_client'

Then run bundle install

Run the generator:

rails generate lolcation_client:install`

In your model add follow code:

  class LolcalizationModel < ApplicationRecord
    extend LolcationClient
  end

You can also define lolcation_fields and lolcation_custom_fields, so you can filter later when you need

class LolcalizationModel < ApplicationRecord
  extend LolcationClient

  lolcation_fields latitude: :my_latitude_attr, address_street: :my_street_attr
  lolcation_custom_fields :foo, :bar, :baz
end

Run the generator to create location fields:

rails generate lolcation_client:migration MODEL

Run your migrate:

rails db:migrate

You must set your token at : config/lolcation.yml

development:
  token: 'TOKEN'
  sandbox: true
staging:
  token: 'TOKEN'
  sandbox: true
production:
  token: 'TOKEN'

Finding closest localizations with the method near_me method

LocalizationModel.near_in(latitude: lat, longitude: lgt, distance: 10.0, filter: {foo: 'bar'})
  • Note that filter will look up for custom_fields!

If you want just return the lolcationId field, just add option only_ids: true like:

LocalizationModel.near_in(latitude: lat, longitude: lgt, distance: 10.0, filter: {foo: 'bar'}, only_ids: true)

Versioning

LOLCATION CLIENT follows the Semantic Versioning standard.

Issues

If you have problems, please create a Github Issue.

Contributing

Please see CONTRIBUTING.md for details.

Maintainers

Release

Follow this steps to release a new version of the gem.

  1. Test if everything is running ok;
  2. Change version of the gem on VERSION constant;
  3. Add the release date on the CHANGELOG;
  4. Do a commit "Bump version x.x.x", follow the semantic version;
  5. Run $ rake release, this will send the gem to the rubygems;
  6. Check if the gem is on the rubygems and the tags are correct on the github;

Made with love by LolDesign

This gem was created and is maintained by LolDesign.