0.0
No commit activity in last 3 years
No release in over 3 years
Hook Client for Ruby
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 3.0.0
>= 2.0.0

Runtime

~> 0.6.0
>= 0
 Project Readme

hook-ruby client Build status

ruby client for hook.

Getting started:

# Gemfile
gem '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.")
puts client.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:

class Post
  include Hook::Model

  field :title
  field :description

  validates_presence_of :title
end

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