Sha256: c3a4177a71f3d26c44b46d07848d8e33eb2780815c91e35c19c6ac7f5cdd0538

Contents?: true

Size: 640 Bytes

Versions: 2

Compression:

Stored size: 640 Bytes

Contents

# encoding: UTF-8

module GoodData
  class Profile
    private_class_method :new
    attr_reader :user, :json

    class << self
      def load
        # GoodData.logger.info "Loading user profile..."
        Profile.send 'new'
      end
    end

    def projects
      @json['accountSetting']['links']['projects']
    end

    alias_method :to_json, :json

    def [](key, options = {})
      @json['accountSetting'][key]
    end

    private

    def initialize
      @json = GoodData.get GoodData.connection.user['profile']
      @user = @json['accountSetting']['firstName'] + ' ' + @json['accountSetting']['lastName']
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gooddata-0.6.3 lib/gooddata/models/profile.rb
gooddata-0.6.2 lib/gooddata/models/profile.rb