Class: DMM::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby-dmm/client.rb

Constant Summary collapse

BASE_URL =
'https://api.dmm.com/affiliate/v3/'.freeze
DEFAULT_USER_AGENT =
"ruby-dmm gem #{DMM::VERSION}".freeze
API_MAP =
{
  product: 'ItemList',      # 商品情報
  floor:   'FloorList',     # フロア
  actress: 'ActressSearch', # 女優検索
  genre:   'GenreSearch',   # ジャンル検索
  maker:   'MakerSearch',   # メーカー検索
  series:  'SeriesSearch',  # シリーズ検索
  author:  'AuthorSearch',  # 作者検索
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



14
15
16
17
18
# File 'lib/ruby-dmm/client.rb', line 14

def initialize(options = {})
  @api_id       = (ENV['DMM_API_ID']       || options[:api_id])
  @affiliate_id = (ENV['DMM_AFFILIATE_ID'] || options[:affiliate_id])
  @user_agent   = (ENV['DMM_USER_AGENT']   || options[:user_agent] || DEFAULT_USER_AGENT)
end