Sha256: 0c839ae911aa185aca3818755d10fa8733d7a79e262e6c789a7403d72952790c

Contents?: true

Size: 1.62 KB

Versions: 4

Compression:

Stored size: 1.62 KB

Contents

# encoding: UTF-8

require_relative '../rest/rest'

module GoodData
  class Invitation < GoodData::Rest::Object
    def initialize(json)
      @json = json
    end

    def author
      data = client.get @json['invitation']['meta']['author']
      client.create GoodData::AccountSettings, data
    end

    def contributor
      data = client.get @json['invitation']['meta']['contributor']
      client.create GoodData::AccountSettings, data
    end

    def created
      DateTime.parse(@json['invitation']['meta']['created'])
    end

    def email
      @json['invitation']['content']['email']
    end

    def first_name
      @json['invitation']['content']['firstname']
    end

    def first_name
      @json['invitation']['content']['firstname']
    end

    def phone
      @json['invitation']['content']['phone']
    end

    def profile
      data = client.get @json['invitation']['links']['profile']
      client.create GoodData::AccountSettings, data
    end

    def project
      data = client.get @json['invitation']['links']['project']
      client.create GoodData::Project, data
    end

    def project_name
      @json['invitation']['content']['projectname']
    end

    def role
      # TODO: Return object instead
      @json['invitation']['content']['role']
    end

    def status
      @json['invitation']['content']['status']
    end

    def summary
      @json['invitation']['content']['summary']
    end

    def title
      @json['invitation']['content']['title']
    end

    def updated
      DateTime.parse(@json['invitation']['meta']['updated'])
    end

    def uri
      @json['invitation']['links']['self']
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
gooddata-0.6.11 lib/gooddata/models/invitation.rb
gooddata-0.6.10 lib/gooddata/models/invitation.rb
gooddata-0.6.9 lib/gooddata/models/invitation.rb
gooddata-0.6.8 lib/gooddata/models/invitation.rb