Sha256: 398219651171ed578fae0d6c004b2c6b1bf6a224717e6edc4770027c66501ca4

Contents?: true

Size: 848 Bytes

Versions: 3

Compression:

Stored size: 848 Bytes

Contents

module Gattica
  
  # Represents an account that an authenticated user has access to
  
  class Account
    
    include Convertible
    
    attr_reader :id, :updated, :title, :table_id, :account_id, :account_name, :profile_id, :web_property_id
  
    def initialize(xml)
      @id = xml.at_xpath('xmlns:id').text
      @updated = DateTime.parse(xml.at_xpath('xmlns:updated').text)
      @title = xml.at_xpath('xmlns:title').text
      @table_id = xml.at_xpath('dxp:tableid').text
      @account_id = xml.at_xpath("dxp:property[@name='ga:accountId']")['value'].to_i
      @account_name = xml.at_xpath("dxp:property[@name='ga:accountName']")['value']
      @profile_id = xml.at_xpath("dxp:property[@name='ga:profileId']")['value'].to_i
      @web_property_id = xml.at_xpath("dxp:property[@name='ga:webPropertyId']")['value']
    end
    
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
gicodewarrior-gattica-0.5.2 lib/gattica/account.rb
gicodewarrior-gattica-0.5.1 lib/gattica/account.rb
gicodewarrior-gattica-0.5.0 lib/gattica/account.rb