NameDrop
NameDrop provides a ruby interface to the Mention API
Information
- RDoc documentation available on RubyDoc.info
- Source code available on GitHub
Installation
Add this line to your application's Gemfile:
gem 'name_drop'And then execute:
$ bundle
Or install it yourself as:
$ gem install name_drop
Configuration
Add an initializer file (In rails typically you would name the file: config/initializers/name_drop.rb)
NameDrop.configure do |config|
config.account_id = ENV['MENTION_API_ACCOUNT_ID']
config.access_token = ENV['MENTION_API_ACCESS_TOKEN']
endUsage
Creating a client
client = NameDrop::Client.newFetching all objects
all_alerts = client.alerts.allFetching single object
alert = client.alert.find(mention_alert_id)Create object
alert = client.alert.build(new_attributes_hash)
alert.saveUpdate object
alert = client.alert.find(mention_alert_id)
alert.attributes = updated_attributes_hash
alert.saveDestroy object
shares = client.share.all(alert_id: 1)
shares.each do |share|
share.destroy
endDevelopment
After checking out the repo, run bin/setup to install dependencies. Then, run rake spec to run the tests. You can also run bin/console for an interactive prompt that will allow you to experiment.
To install this gem onto your local machine, run bundle exec rake install. To release a new version, update the version number in version.rb, and then run bundle exec rake release, which will create a git tag for the version, push git commits and tags, and push the .gem file to rubygems.org.
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/500friends/name_drop. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.