Skip to content

yuanping/event-log-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

EventLog::Client

A Ruby interface to the EventLog API.

Installation

Add this line to your application's Gemfile:

gem 'event-log-sdk', git: 'git://github.com/yuanping/event-log-sdk.git'

And then execute:

$ bundle

Usage

client = EventLog::Client.new host: 'http://lvh.me:3000', token: '1922:RkPYCtz7v9p-KHh7LCxv', version: 'v1'

event = { 
  model_name: 'Order',
  model_id: '1',
  category: 'CRM',
  content: 'price 20=>30',
  event: 'update',
  operator: 'yp',
  operator_id: '[email protected]',
  link: 'http://fishtrip.cn'
}

client.create_event_log event.to_json
 #=> success response code: 201
 
client.event_logs
 #=> [{model_name: 'Order', model_id: '1', content: 'update price: 20 => 30', ...}, {...}]

Contributing

  1. Fork it ( https://github.com/yuanping/event-log-sdk/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

About

A Ruby interface to the EventLog API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages