Method: BacklogKit::Client#initialize

Defined in:
lib/backlog_kit/client.rb

#initialize(options = {}) ⇒ Client

Initialize a new Client object with given options

Parameters:

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

    Initialize options

Options Hash (options):

  • :space_id (String)

    Backlog space id

  • :top_level_domain (String)

    Backlog top level domain

  • :api_key (String)

    Backlog api key

  • :client_id (String)

    Backlog OAuth client id

  • :client_secret (String)

    Backlog OAuth client secret

  • :refresh_token (String)

    Backlog OAuth refresh token



65
66
67
68
69
70
71
72
73
74
75
76
# File 'lib/backlog_kit/client.rb', line 65

def initialize(options = {})
  @space_id         = ENV['BACKLOG_SPACE_ID']
  @top_level_domain = ENV['BACKLOG_TOP_LEVEL_DOMAIN'] || 'jp'
  @api_key          = ENV['BACKLOG_API_KEY']
  @client_id        = ENV['BACKLOG_OAUTH_CLIENT_ID']
  @client_secret    = ENV['BACKLOG_OAUTH_CLIENT_SECRET']
  @refresh_token    = ENV['BACKLOG_OAUTH_REFRESH_TOKEN']

  options.each do |key, value|
    instance_variable_set(:"@#{key}", value)
  end
end