Class: Dmm::Client

Inherits:
Object
  • Object
show all
Includes:
API::Items
Defined in:
lib/dmm/client.rb

Constant Summary collapse

ROOT_URL =
'http://affiliate-api.dmm.com'
API_VERSION =
'2.00'
COM =
'DMM.com'
R18 =
'DMM.co.jp'
OPTIONS =
[:api_id, :affiliate_id]

Instance Method Summary collapse

Methods included from API::Items

#item_list

Constructor Details

#initialize(options = {}) ⇒ Dmm::Client

Initialize a new Client object

Parameters:

  • options (Hash) (defaults to: {})


24
25
26
27
28
29
# File 'lib/dmm/client.rb', line 24

def initialize(options={})
  OPTIONS.each do |id|
    send("#{id}=", options[id])
  end
  @time = Time.now.to_s
end

Instance Method Details

#get(path, params = {}) ⇒ Object

Perform an HTTP GET request



32
33
34
# File 'lib/dmm/client.rb', line 32

def get(path, params={})
  request(:get, path, params)
end