class GTM::Pull
Attributes
client[RW]
Public Class Methods
new(client)
click to toggle source
# File lib/gtm/pull.rb, line 12 def initialize(client) @client = client end
Public Instance Methods
account_ids()
click to toggle source
# File lib/gtm/pull.rb, line 23 def account_ids if @client.scope[:account_id] [@client.scope[:account_id]] else get_account_ids end end
get_account_ids()
click to toggle source
# File lib/gtm/pull.rb, line 31 def get_account_ids @client.run do |accounts| account_ids = accounts.map { |a| a['accountId'] } return account_ids end [] end
get_container(account_id)
click to toggle source
# File lib/gtm/pull.rb, line 39 def get_container(account_id) result = @client.client.execute( api_method: @client.gtm.accounts.containers.list, parameters: { accountId: account_id } ) result.data.containers end
run()
click to toggle source
# File lib/gtm/pull.rb, line 16 def run account_ids.each do |account_id| @client.scope[:account_id] = account_id pull_tags end end