Class: Garb::Profile
- Inherits:
-
Object
- Object
- Garb::Profile
- Defined in:
- lib/garb/profile.rb
Defined Under Namespace
Instance Attribute Summary collapse
-
#account_id ⇒ Object
readonly
Returns the value of attribute account_id.
-
#account_name ⇒ Object
readonly
Returns the value of attribute account_name.
-
#table_id ⇒ Object
readonly
Returns the value of attribute table_id.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
Class Method Summary collapse
Instance Method Summary collapse
- #id ⇒ Object
-
#initialize(entry) ⇒ Profile
constructor
A new instance of Profile.
Constructor Details
#initialize(entry) ⇒ Profile
Returns a new instance of Profile.
31 32 33 34 35 36 37 38 |
# File 'lib/garb/profile.rb', line 31 def initialize(entry) @title = entry.title @table_id = entry.tableId entry.properties.each do |p| instance_variable_set :"@#{p.instance_name}", p.value end end |
Instance Attribute Details
#account_id ⇒ Object (readonly)
Returns the value of attribute account_id.
4 5 6 |
# File 'lib/garb/profile.rb', line 4 def account_id @account_id end |
#account_name ⇒ Object (readonly)
Returns the value of attribute account_name.
4 5 6 |
# File 'lib/garb/profile.rb', line 4 def account_name @account_name end |
#table_id ⇒ Object (readonly)
Returns the value of attribute table_id.
4 5 6 |
# File 'lib/garb/profile.rb', line 4 def table_id @table_id end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
4 5 6 |
# File 'lib/garb/profile.rb', line 4 def title @title end |
Class Method Details
.all ⇒ Object
44 45 46 47 48 |
# File 'lib/garb/profile.rb', line 44 def self.all url = "https://www.google.com/analytics/feeds/accounts/default" response = DataRequest.new(url).send_request Entry.parse(response.body).map {|entry| new(entry)} end |
Instance Method Details
#id ⇒ Object
40 41 42 |
# File 'lib/garb/profile.rb', line 40 def id @table_id.from_ga end |