# Lifen Lifen is a ruby client for [Lifen](https://www.lifen.fr/) JSON API. ## Installation Add this line to your application's Gemfile: gem 'lifen' And then execute: $ bundle Or install it yourself as: $ gem install lifen ## Usage ### Configuration Lifen can be configured (ideally inside an initializer) like so: Lifen.configure do |config| config.site = "https://develop.lifen.fr/" config.application_access_token = "application_access_token" config.proxy_url = "http://my.proxy.fr/" end `site` and `application_access_token` are mandatory attributes. ### Managing users user = Lifen::User.new(email: "email@domain.tld", first_name: "Jean", last_name: "Dupont") user.create user.token.refresh user.status.refresh ### Managing flows user = Lifen::User.new(uuid: "valid_uuid") user.flows flow = Lifen::Flow.new(user: user, title: "honestica Rocks !") flow.create flow.attach_users(user) flow.detach_users(user) flow = Lifen::Flow.new(user: user, title: "honestica Rocks !", users: [user_1, user_2]) flow.create ### Managing messages message = Lifen::Message.new(flow: flow, content: "Hello World !") message.create ## Contributing 1. Fork it 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 new Pull Request ## License The MIT License (MIT) Copyright (c) 2016 Honestica Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.