Class: GoogleApi::Ga::Account

Inherits:
Management show all
Defined in:
lib/google_api/ga/management/account.rb

Instance Attribute Summary

Attributes inherited from Management

#created, #id, #name, #updated

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Management

#camelize

Constructor Details

#initialize(account) ⇒ Account

Returns a new instance of Account.



5
6
7
# File 'lib/google_api/ga/management/account.rb', line 5

def initialize()
  set()
end

Class Method Details

.all(account_id = '~all') ⇒ Object



9
10
11
# File 'lib/google_api/ga/management/account.rb', line 9

def self.all( = '~all')
  get({ accountId:  }).map { || Account.new() }
end

.find(account_id) ⇒ Object



13
14
15
# File 'lib/google_api/ga/management/account.rb', line 13

def self.find()
  all().first
end

Instance Method Details

#refreshObject



17
18
19
20
21
22
23
# File 'lib/google_api/ga/management/account.rb', line 17

def refresh
  @webproperties = nil

  set( Account.get({ accountId: @id }).first )

  return true
end

#webpropertiesObject



25
26
27
# File 'lib/google_api/ga/management/account.rb', line 25

def webproperties
  @webproperties ||= Webproperty.all(@id)
end