Class: GoogleApi::Ga::Webproperty

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

Instance Attribute Summary collapse

Attributes inherited from Management

#created, #id, #name, #updated

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Management

#camelize

Constructor Details

#initialize(webproperty) ⇒ Webproperty

Returns a new instance of Webproperty.



8
9
10
# File 'lib/google_api/ga/management/webproperty.rb', line 8

def initialize(webproperty)
  set(webproperty)
end

Instance Attribute Details

#account_idObject (readonly)

Returns the value of attribute account_id.



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

def 
  @account_id
end

#website_urlObject (readonly)

Returns the value of attribute website_url.



6
7
8
# File 'lib/google_api/ga/management/webproperty.rb', line 6

def website_url
  @website_url
end

Class Method Details

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



12
13
14
# File 'lib/google_api/ga/management/webproperty.rb', line 12

def self.all( = '~all', webproperty_id = '~all')
  get({ accountId: , webPropertyId: webproperty_id }).map { |webproperty| Webproperty.new(webproperty) }
end

.find(webproperty_id) ⇒ Object



16
17
18
# File 'lib/google_api/ga/management/webproperty.rb', line 16

def self.find(webproperty_id)
  all('~all', webproperty_id).first
end

Instance Method Details

#accountObject



29
30
31
# File 'lib/google_api/ga/management/webproperty.rb', line 29

def 
  @account ||= Account.find(@account_id)
end

#profilesObject



33
34
35
# File 'lib/google_api/ga/management/webproperty.rb', line 33

def profiles
  @profiles ||= Profile.all(@account_id, @id)
end

#refreshObject



20
21
22
23
24
25
26
27
# File 'lib/google_api/ga/management/webproperty.rb', line 20

def refresh
  @account  = nil
  @profiles = nil

  set( Webproperty.get({ accountId: @account_id, webPropertyId: @id }).first )

  return true
end