Sha256: e0e220dc8e7adb9715b3c8290c12e4914385e57bc1b305f7b5af567b68d578c9

Contents?: true

Size: 636 Bytes

Versions: 1

Compression:

Stored size: 636 Bytes

Contents

require 'appstore_kit_fork/models/model'

module AppstoreKitFork
  # Simple model class for representing Users in the App Store Connect API
  class User < Model
    attr_reader :first_name, :last_name, :username, :roles, :all_apps_visible

    def initialize(options)
      super(options)

      attrs = options['attributes']
      @first_name = attrs['firstName']
      @last_name = attrs['lastName']
      @username = attrs['username']
      @all_apps_visible = attrs['allAppsVisible']
      @roles = attrs['roles'].map { |role| role.downcase.to_sym }
    end

    def full_name
      "#{@first_name} #{@last_name}"
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
appstore_kit_fork-0.0.6 lib/appstore_kit_fork/models/user.rb