Class: BacklogJp::Client

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

Constant Summary collapse

AuthenticationException =
Class.new Exception
APIException =
Class.new Exception

Instance Method Summary collapse

Constructor Details

#initialize(config = {}) ⇒ Client

Returns a new instance of Client.



8
9
10
11
12
13
14
15
16
17
18
# File 'lib/backlog_jp/client.rb', line 8

def initialize config = {}
  config[:space]   ||= ENV["BACKLOG_SPACE"]
  config[:api_key] ||= ENV["BACKLOG_API_KEY"]

  unless config[:space] && config[:api_key]
    fail AuthenticationException, "`:space` and `:api_key` are required for authentication."
  end

  @space   = config[:space]
  @api_key = config[:api_key]
end