Class: TrophyApiClient::AsyncClient

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::PRODUCTION, max_retries: nil, timeout_in_seconds: nil) ⇒ TrophyApiClient::AsyncClient



78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
# File 'lib/trophy_api_client.rb', line 78

def initialize(api_key:, base_url: nil, environment: TrophyApiClient::Environment::PRODUCTION, max_retries: nil,
               timeout_in_seconds: nil)
  @async_request_client = TrophyApiClient::AsyncRequestClient.new(
    base_url: base_url,
    environment: environment,
    max_retries: max_retries,
    timeout_in_seconds: timeout_in_seconds,
    api_key: api_key
  )
  @achievements = TrophyApiClient::AsyncAchievementsClient.new(request_client: @async_request_client)
  @metrics = TrophyApiClient::AsyncMetricsClient.new(request_client: @async_request_client)
  @users = TrophyApiClient::AsyncUsersClient.new(request_client: @async_request_client)
  @streaks = TrophyApiClient::AsyncStreaksClient.new(request_client: @async_request_client)
  @points = TrophyApiClient::AsyncPointsClient.new(request_client: @async_request_client)
  @leaderboards = TrophyApiClient::AsyncLeaderboardsClient.new(request_client: @async_request_client)
  @admin = TrophyApiClient::Admin::AsyncClient.new(request_client: @async_request_client)
end

Instance Attribute Details

#achievementsTrophyApiClient::AsyncAchievementsClient (readonly)



58
59
60
# File 'lib/trophy_api_client.rb', line 58

def achievements
  @achievements
end

#adminTrophyApiClient::Admin::AsyncClient (readonly)



70
71
72
# File 'lib/trophy_api_client.rb', line 70

def admin
  @admin
end

#leaderboardsTrophyApiClient::AsyncLeaderboardsClient (readonly)



68
69
70
# File 'lib/trophy_api_client.rb', line 68

def leaderboards
  @leaderboards
end

#metricsTrophyApiClient::AsyncMetricsClient (readonly)



60
61
62
# File 'lib/trophy_api_client.rb', line 60

def metrics
  @metrics
end

#pointsTrophyApiClient::AsyncPointsClient (readonly)



66
67
68
# File 'lib/trophy_api_client.rb', line 66

def points
  @points
end

#streaksTrophyApiClient::AsyncStreaksClient (readonly)



64
65
66
# File 'lib/trophy_api_client.rb', line 64

def streaks
  @streaks
end

#usersTrophyApiClient::AsyncUsersClient (readonly)



62
63
64
# File 'lib/trophy_api_client.rb', line 62

def users
  @users
end