Class: RubyDuga::Client

Inherits:
Object
  • Object
show all
Defined in:
lib/ruby_duga/client.rb

Constant Summary collapse

BASE_URL =
"http://affapi.duga.jp/".freeze
DEFAULT_AGENT_ID =
"40413".freeze
DEFAULT_BANNER_ID =
"01".freeze
API_VERSION =
"1.2".freeze
API_MAP =
{
  search: "search"
}.freeze

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Client

Returns a new instance of Client.



12
13
14
15
16
# File 'lib/ruby_duga/client.rb', line 12

def initialize(options = {})
  @appid    = (ENV["DUGA_APP_ID"]       || options[:app_id])
  @agentid  = (ENV["DUGA_AGENT_ID"]     || options[:agent_id]  || DEFAULT_AGENT_ID)
  @bannerid = (ENV["DUGA_BANNER_AGENT"] || options[:banner_id] || DEFAULT_BANNER_ID)
end