0.0
No commit activity in last 3 years
No release in over 3 years
about rest-sessions ruby client,use em-http-request
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.12
~> 10.0
 Project Readme

em-sessions

em-sessions is rest-sessions ruby client, about see: rest-sessions.

Installation

Install em-sessions as a gem:

gem install em-sessions

or add to your Gemfile:

# Gemfile
gem 'em-http-request'
gem 'em-sessions'

and run bundle install to install the dependency.

Initialize

# default: init(url = 'localhost:3000', app = 'weapp')
Em::Sessions.init
client = Em::Sessions.client

or

client = Em::Sessions.client 'localhost:3000', 'weapp'

Notice

client`s all methods return two params, one code, one json, such as:

 client.create '1' # [200, {"token": "9kwi9wu429dkw8urkhr923jrekw32" ]

you can

 code, json = client.create '1'
 json['token'] # 9kwi9wu429dkw8urkhr923jrekw32

Use List

  client.create(id, out_time = 7200, ip = '0.0.0.0')

  client.find_by_token(token)

  client.find_by_id(id)

  client.set_params_by_token(token, params = {})

  client.delete_by_token(token)

  client.delete_by_id(id)

  client.delete_all

  client.activity?

Copyright

Copyright © 2011-2016. See LICENSE for details.