<commit_before># encoding: UTF-8

module GoodData
  class ProjectRole
    def initialize(json)
      @json = json
    end

    def identifier
      @json['projectRole']['meta']['identifier']
    end

    def author
      @json['projectRole']['meta']['author']
    end

    def contributor
      @json['projectRole']['meta']['contributor']
    end

    def created
      Time.parse(@json['projectRole']['meta']['created'])
    end

    def permissions
      @json['projectRole']['permissions']
    end

    def title
      @json['projectRole']['meta']['title']
    end

    def summary
      @json['projectRole']['meta']['summary']
    end

    def updated
      Time.parse(@json['projectRole']['meta']['updated'])
    end
  end
end<commit_msg>Fixed problem with no accessor for uri in GoodData::ProjetcRole<commit_after># encoding: UTF-8

require_relative 'account_settings'

module GoodData
  class ProjectRole
    def initialize(json)
      @json = json
    end

    # Gets Project Role Identifier
    #
    # @returns [string] Project Role
    def identifier
      @json['projectRole']['meta']['identifier']
    end

    # Gets Project Role Author
    #
    # @returns [GoodData::AccountSettings] Project Role author
    def author
      url = @json['projectRole']['meta']['author']
      tmp = GoodData.get url
      GoodData::AccountSettings.new(tmp)
    end

    # Gets Project Role Contributor
    #
    # @returns [GoodData::AccountSettings] Project Role Contributor
    def contributor
      url = @json['projectRole']['meta']['contributor']
      tmp = GoodData.get url
      GoodData::AccountSettings.new(tmp)
    end

    # Gets Date time when created
    #
    # @returns [string] Date time of creation
    def created
      Time.parse(@json['projectRole']['meta']['created'])
    end

    # Gets Project Role Permissions
    #
    # @returns [string] Project Role
    def permissions
      @json['projectRole']['permissions']
    end

    # Gets Project Role Title
    #
    # @returns [string] Project Role Title
    def title
      @json['projectRole']['meta']['title']
    end

    # Gets Project Role Summary
    #
    # @returns [string] Project Role Summary
    def summary
      @json['projectRole']['meta']['summary']
    end

    # Gets Date time when updated
    #
    # @returns [Time] Date time of last update
    def updated
      Time.parse(@json['projectRole']['meta']['updated'])
    end

    # Gets Users with this Role
    #
    # @returns [Array<GoodData::AccountSettings>] List of users
    def users
      res = []
      url = @json['projectRole']['links']['roleUsers']
      tmp = GoodData.get url
      tmp['associatedUsers']['users'].each do |user_url|
        user = GoodData.get user_url
        res << GoodData::AccountSettings.new(user)
      end
      res
    end

    # Gets Raw object URI
    #
    # @returns [string] URI of this project role
    def uri
      @json['projectRole']['links']['roleUsers'].split('/').join('/')
    end
  end
end
{'fraction_non_alphanumeric': 0.1285140562248996, 'fraction_numerical': 0.0006693440428380187, 'mean_word_length': 2.788339670468948, 'pattern_counts': {'":': 0, '<': 6, '<?xml version=': 0, '>': 4, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7230674', 'n_tokens_mistral': 845, 'n_tokens_neox': 820, 'n_words': 230}