Class: Legion::CLI::Chat::Team::UserContext

Inherits:
Object
  • Object
show all
Defined in:
lib/legion/cli/chat/team.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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_nameObject (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_idObject (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_idObject (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_hObject



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