Sha256: cda359c670225ef60e8a75fa0d8667cd823fbc65744275267c084ca0383fff42

Contents?: true

Size: 535 Bytes

Versions: 13

Compression:

Stored size: 535 Bytes

Contents

module Lingohub
  module Models
    class Collaborator
      attr_accessor :email, :display_name, :roles

      ROLES_NAMES = { "project_admin" => "Project admin", "developer" => "Developer" }

      def initialize(client, link)
        @client = client
        @link = link
      end

      def destroy
        @client.delete @link
      end

      def permissions
        return "None" if self.roles.nil? or self.roles.empty?

        self.roles.find_all { |role| ROLES_NAMES.has_key?(role) }.join(", ")
      end

    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
lingohub-0.3.1 lib/lingohub/models/collaborator.rb
lingohub-0.3.0 lib/lingohub/models/collaborator.rb
lingohub-0.2.1 lib/lingohub/models/collaborator.rb
lingohub-0.2.0 lib/lingohub/models/collaborator.rb
lingohub-0.1.1 lib/lingohub/models/collaborator.rb
lingohub-0.1.0 lib/lingohub/models/collaborator.rb
lingohub-0.0.10 lib/lingohub/models/collaborator.rb
lingohub-0.0.9 lib/lingohub/models/collaborator.rb
lingohub-0.0.8 lib/lingohub/models/collaborator.rb
lingohub-0.0.7 lib/lingohub/models/collaborator.rb
lingohub-0.0.6 lib/lingohub/models/collaborator.rb
lingohub-0.0.5 lib/lingohub/models/collaborator.rb
lingohub-0.0.4 lib/lingohub/models/collaborator.rb