Class: Kokkai::Client

Inherits:
Object
  • Object
show all
Includes:
ApiMethods
Defined in:
lib/kokkai/client.rb

Instance Method Summary collapse

Methods included from ApiMethods

#meeting, #speech

Constructor Details

#initializeClient

Returns a new instance of Client.



9
10
# File 'lib/kokkai/client.rb', line 9

def initialize
end

Instance Method Details

#kokkai_connectionObject



21
22
23
24
25
26
27
28
# File 'lib/kokkai/client.rb', line 21

def kokkai_connection
  @kokkai_connection ||= Faraday.new(faraday_options) do |c|
    c.request  :url_encoded
    c.response :xml,  :content_type => /\bxml$/
    c.adapter Faraday.default_adapter
    c.options.params_encoder = ParamsEncoder
  end
end

#send_get(path, params = nil) ⇒ Object



12
13
14
# File 'lib/kokkai/client.rb', line 12

def send_get(path, params = nil)
  send_request(:get, path, params)
end

#send_request(method, path, params = nil) ⇒ Object



16
17
18
19
# File 'lib/kokkai/client.rb', line 16

def send_request(method, path, params = nil)
  response = kokkai_connection.send(method, path, params)
  Kokkai::Response.new(response)
end