Skip to content

Repository files navigation

hook-ruby client Build status

ruby client for hook.

Getting started:

# Gemfilegem'hook-client'

Basic usage:

require'hook-client'client=Hook::Client(:app_id=>1,:key=>"something",:endpoint=>"https://dl-api.heroku.com")client.collection(:posts).create(:title=>"Getting Started",:description=>"Getting started with dl-api-ruby.")putsclient.collection(:posts).where(:title=>"Getting Started").count

For more examples, please see our tests.

Using it with Rails

Set-up with your credentials:

Hook::Client.configure(:app_id=>1,:key=>"1f143fde82d14643099ae45e6c98c8e1",:endpoint=>"https://dl-api.heroku.com")

Define your models:

classPostincludeHook::Modelfield:titlefield:descriptionvalidates_presence_of:titleend

Hook::Model's uses almost the same syntax as ActiveRecord, which you're already familiar with.

You will be able to use any ActiveModel goodies, such as validation, serialization and dirty methods.

License

MIT

About

Ruby client for hook

Resources

Stars

3 stars

Watchers

14 watching

Forks

Releases

Packages

Used by

Contributors

Languages