Class: Legion::CLI::Chat::Team::UserContext
- Inherits:
-
Object
- Object
- Legion::CLI::Chat::Team::UserContext
- Defined in:
- lib/legion/cli/chat/team.rb
Instance Attribute Summary collapse
-
#display_name ⇒ Object
readonly
Returns the value of attribute display_name.
-
#team_id ⇒ Object
readonly
Returns the value of attribute team_id.
-
#user_id ⇒ Object
readonly
Returns the value of attribute user_id.
Instance Method Summary collapse
-
#initialize(user_id:, team_id: nil, display_name: nil) ⇒ UserContext
constructor
A new instance of UserContext.
- #to_h ⇒ Object
Constructor Details
#initialize(user_id:, team_id: nil, display_name: nil) ⇒ UserContext
Returns a new instance of UserContext.
10 11 12 13 14 |
# File 'lib/legion/cli/chat/team.rb', line 10 def initialize(user_id:, team_id: nil, display_name: nil) @user_id = user_id @team_id = team_id @display_name = display_name || user_id end |
Instance Attribute Details
#display_name ⇒ Object (readonly)
Returns the value of attribute display_name.
8 9 10 |
# File 'lib/legion/cli/chat/team.rb', line 8 def display_name @display_name end |
#team_id ⇒ Object (readonly)
Returns the value of attribute team_id.
8 9 10 |
# File 'lib/legion/cli/chat/team.rb', line 8 def team_id @team_id end |
#user_id ⇒ Object (readonly)
Returns the value of attribute user_id.
8 9 10 |
# File 'lib/legion/cli/chat/team.rb', line 8 def user_id @user_id end |
Instance Method Details
#to_h ⇒ Object
16 17 18 |
# File 'lib/legion/cli/chat/team.rb', line 16 def to_h { user_id: user_id, team_id: team_id, display_name: display_name } end |