Class: Ga4Rails::AnalyticsAdmin

Inherits:
Object
  • Object
show all
Defined in:
lib/ga4-rails/api/analytics_admin.rb

Constant Summary collapse

Analyticsadmin =
Google::Apis::AnalyticsadminV1alpha

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(access_token:) ⇒ AnalyticsAdmin

Returns a new instance of AnalyticsAdmin.



18
19
20
# File 'lib/ga4-rails/api/analytics_admin.rb', line 18

def initialize(access_token:)
  @access_token = access_token
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



16
17
18
# File 'lib/ga4-rails/api/analytics_admin.rb', line 16

def access_token
  @access_token
end

Instance Method Details

#serviceObject



22
23
24
25
26
27
28
# File 'lib/ga4-rails/api/analytics_admin.rb', line 22

def service
  return @service if @service

  @service = Analyticsadmin::GoogleAnalyticsAdminService.new
  @service.authorization = access_token
  @service
end