Sha256: f9c26b08b4e2fe24983874f82fba3e77caeabb645cc2e4936e5683b6ca8e59a6

Contents?: true

Size: 621 Bytes

Versions: 1

Compression:

Stored size: 621 Bytes

Contents

# encoding: UTF-8

module GoodData
  class Profile
    private_class_method :new
    attr_reader :user

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

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

    def to_json
      @json
    end

    def [](key)
      @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

1 entries across 1 versions & 1 rubygems

Version Path
gooddata-0.6.0 lib/gooddata/models/profile.rb