Class: Gitlab::QuickActions::UsersExtractor
- Inherits:
-
Object
- Object
- Gitlab::QuickActions::UsersExtractor
- Defined in:
- lib/gitlab/quick_actions/users_extractor.rb
Constant Summary collapse
- MAX_QUICK_ACTION_USERS =
100
- Error =
Class.new(ArgumentError)
- TooManyError =
Class.new(Error) do def limit MAX_QUICK_ACTION_USERS end end
- MissingError =
Class.new(Error)
- TooManyFoundError =
Class.new(TooManyError)
- TooManyRefsError =
Class.new(TooManyError)
Instance Attribute Summary collapse
-
#current_user ⇒ Object
readonly
Returns the value of attribute current_user.
-
#group ⇒ Object
readonly
Returns the value of attribute group.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
-
#target ⇒ Object
readonly
Returns the value of attribute target.
-
#text ⇒ Object
readonly
Returns the value of attribute text.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(current_user, project:, group:, target:, text:) ⇒ UsersExtractor
constructor
A new instance of UsersExtractor.
Constructor Details
#initialize(current_user, project:, group:, target:, text:) ⇒ UsersExtractor
Returns a new instance of UsersExtractor.
21 22 23 24 25 26 27 |
# File 'lib/gitlab/quick_actions/users_extractor.rb', line 21 def initialize(current_user, project:, group:, target:, text:) @current_user = current_user @project = project @group = group @target = target @text = text end |
Instance Attribute Details
#current_user ⇒ Object (readonly)
Returns the value of attribute current_user.
19 20 21 |
# File 'lib/gitlab/quick_actions/users_extractor.rb', line 19 def current_user @current_user end |
#group ⇒ Object (readonly)
Returns the value of attribute group.
19 20 21 |
# File 'lib/gitlab/quick_actions/users_extractor.rb', line 19 def group @group end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
19 20 21 |
# File 'lib/gitlab/quick_actions/users_extractor.rb', line 19 def project @project end |
#target ⇒ Object (readonly)
Returns the value of attribute target.
19 20 21 |
# File 'lib/gitlab/quick_actions/users_extractor.rb', line 19 def target @target end |
#text ⇒ Object (readonly)
Returns the value of attribute text.
19 20 21 |
# File 'lib/gitlab/quick_actions/users_extractor.rb', line 19 def text @text end |
Instance Method Details
#execute ⇒ Object
29 30 31 32 33 34 35 36 37 |
# File 'lib/gitlab/quick_actions/users_extractor.rb', line 29 def execute return [] unless text.present? users = collect_users check_users!(users) users end |