Sha256: a7715c49716e376f326473caa4896d55e20268376e54c18151891b79d9ff6cd4
Contents?: true
Size: 794 Bytes
Versions: 1
Compression:
Stored size: 794 Bytes
Contents
module Openfire class Client attr_accessor :her_client HER_CLIENT = Her::API.new def initialize(url, token, options={}) url.gsub!(/\/$/,'') url = "http://#{url}" unless url.match /^http/ url = "#{url}/plugins/restapi/v1/" headers = { 'Authorization' => token, 'Content-Type' => 'application/json', 'Accept' => 'application/json' } HER_CLIENT.setup url: url, headers: headers do |c| c.request :json c.response :openfire_xml, content_type: /\bxml$/ c.response :openfire_json, content_type: /\bjson$/ c.use Faraday::Adapter::NetHttp end end def groups @groups ||= Openfire::Ruby::Group end def users @users ||= Openfire::Ruby::User end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
openfire-ruby-0.1.0 | lib/openfire/client.rb |