Class: Gitlab::Triage::Resource::Issue
- Includes:
- Shared::Issuable
- Defined in:
- lib/gitlab/triage/resource/issue.rb
Direct Known Subclasses
Constant Summary collapse
- DATE_FIELDS =
%i[ due_date ].freeze
Constants included from Shared::Issuable
Shared::Issuable::MAX_PARENT_LOOKUP, Shared::Issuable::SourceTooDeep
Constants inherited from Base
Base::CONFIDENTIAL_TEXT, Base::SOURCE_ERROR_MSG
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #closed_by ⇒ Object
- #expired?(today = Date.today) ⇒ Boolean
- #linked_issues ⇒ Object
- #merge_requests_count ⇒ Object
- #related_merge_requests ⇒ Object
Methods included from Shared::Issuable
#author, #full_resource_reference, #group_url, #label_events, #labels, #labels_chronologically, #labels_with_details, #milestone, #project_path, #project_url, #query_label_events, #request_group, #request_project, #root_id, #state
Methods inherited from Base
#build_url, define_field, #expand_resource!, #initialize, #network, #redact_confidential_attributes?, #resource_id, #resource_url, #source, #source_resource, #source_url, #url, #url_opts
Constructor Details
This class inherits a constructor from Gitlab::Triage::Resource::Base
Instance Method Details
#closed_by ⇒ Object
34 35 36 37 38 |
# File 'lib/gitlab/triage/resource/issue.rb', line 34 def closed_by @closed_by ||= network.query_api_cached( resource_url(sub_resource_type: 'closed_by')) .map { |merge_request| MergeRequest.new(merge_request, parent: self) } end |
#expired?(today = Date.today) ⇒ Boolean
46 47 48 |
# File 'lib/gitlab/triage/resource/issue.rb', line 46 def expired?(today = Date.today) due_date && due_date < today end |
#linked_issues ⇒ Object
40 41 42 43 44 |
# File 'lib/gitlab/triage/resource/issue.rb', line 40 def linked_issues @linked_issues ||= network.query_api_cached( resource_url(sub_resource_type: 'links')) .map { |issue| LinkedIssue.new(issue, parent: self) } end |
#merge_requests_count ⇒ Object
24 25 26 |
# File 'lib/gitlab/triage/resource/issue.rb', line 24 def merge_requests_count @merge_requests_count ||= resource.dig(:merge_requests_count) end |
#related_merge_requests ⇒ Object
28 29 30 31 32 |
# File 'lib/gitlab/triage/resource/issue.rb', line 28 def @related_merge_requests ||= network.query_api_cached( resource_url(sub_resource_type: 'related_merge_requests')) .map { |merge_request| MergeRequest.new(merge_request, parent: self) } end |