Class: Docomoru::Client

Inherits:
Object
  • Object
show all
Includes:
DialogueMethods, KnowledgeMethods
Defined in:
lib/docomoru/client.rb

Constant Summary collapse

DEFAULT_HOST =
"api.apigw.smt.docomo.ne.jp"
DEFAULT_USER_AGENT =
"#{self} #{VERSION}"
DEFAULT_HEADERS =
{
  "User-Agent" => DEFAULT_USER_AGENT,
}

Constants included from KnowledgeMethods

KnowledgeMethods::PATH

Constants included from DialogueMethods

DialogueMethods::PATH

Instance Method Summary collapse

Methods included from KnowledgeMethods

#create_knowledge

Methods included from DialogueMethods

#create_dialogue

Constructor Details

#initialize(api_key: nil) ⇒ Client

Returns a new instance of Client.

Parameters:

  • api_key (String) (defaults to: nil)

    API Key issued from docomo.



23
24
25
# File 'lib/docomoru/client.rb', line 23

def initialize(api_key: nil)
  @api_key = api_key
end

Instance Method Details

#get(path, params = nil, headers = nil) ⇒ Object



27
28
29
# File 'lib/docomoru/client.rb', line 27

def get(path, params = nil, headers = nil)
  process(:get, path, params, headers)
end

#post(path, params = nil, headers = nil) ⇒ Object



31
32
33
# File 'lib/docomoru/client.rb', line 31

def post(path, params = nil, headers = nil)
  process(:post, path, params, headers)
end