Class: ConnectorKit::User
- Defined in:
- lib/connector_kit/models/user.rb
Overview
Simple model class for representing Users in the App Store Connect API
Instance Attribute Summary collapse
-
#all_apps_visible ⇒ Object
readonly
Returns the value of attribute all_apps_visible.
-
#first_name ⇒ Object
readonly
Returns the value of attribute first_name.
-
#last_name ⇒ Object
readonly
Returns the value of attribute last_name.
-
#roles ⇒ Object
readonly
Returns the value of attribute roles.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Attributes inherited from Model
Instance Method Summary collapse
- #full_name ⇒ Object
-
#initialize(options) ⇒ User
constructor
A new instance of User.
Constructor Details
#initialize(options) ⇒ User
Returns a new instance of User.
8 9 10 11 12 13 14 15 16 17 |
# File 'lib/connector_kit/models/user.rb', line 8 def initialize() super() attrs = ['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 |
Instance Attribute Details
#all_apps_visible ⇒ Object (readonly)
Returns the value of attribute all_apps_visible.
6 7 8 |
# File 'lib/connector_kit/models/user.rb', line 6 def all_apps_visible @all_apps_visible end |
#first_name ⇒ Object (readonly)
Returns the value of attribute first_name.
6 7 8 |
# File 'lib/connector_kit/models/user.rb', line 6 def first_name @first_name end |
#last_name ⇒ Object (readonly)
Returns the value of attribute last_name.
6 7 8 |
# File 'lib/connector_kit/models/user.rb', line 6 def last_name @last_name end |
#roles ⇒ Object (readonly)
Returns the value of attribute roles.
6 7 8 |
# File 'lib/connector_kit/models/user.rb', line 6 def roles @roles end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
6 7 8 |
# File 'lib/connector_kit/models/user.rb', line 6 def username @username end |
Instance Method Details
#full_name ⇒ Object
19 20 21 |
# File 'lib/connector_kit/models/user.rb', line 19 def full_name "#{@first_name} #{@last_name}" end |