Class: Gitlab::Git::Finders::RefsFinder
- Inherits:
-
Object
- Object
- Gitlab::Git::Finders::RefsFinder
- Defined in:
- lib/gitlab/git/finders/refs_finder.rb
Constant Summary collapse
- UnknownRefTypeError =
Class.new(StandardError)
Instance Attribute Summary collapse
-
#ref_type ⇒ Object
readonly
Returns the value of attribute ref_type.
-
#repository ⇒ Object
readonly
Returns the value of attribute repository.
-
#search ⇒ Object
readonly
Returns the value of attribute search.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(repository, search:, ref_type:) ⇒ RefsFinder
constructor
A new instance of RefsFinder.
Constructor Details
#initialize(repository, search:, ref_type:) ⇒ RefsFinder
Returns a new instance of RefsFinder.
11 12 13 14 15 |
# File 'lib/gitlab/git/finders/refs_finder.rb', line 11 def initialize(repository, search:, ref_type:) @repository = repository @search = search @ref_type = ref_type end |
Instance Attribute Details
#ref_type ⇒ Object (readonly)
Returns the value of attribute ref_type.
7 8 9 |
# File 'lib/gitlab/git/finders/refs_finder.rb', line 7 def ref_type @ref_type end |
#repository ⇒ Object (readonly)
Returns the value of attribute repository.
7 8 9 |
# File 'lib/gitlab/git/finders/refs_finder.rb', line 7 def repository @repository end |
#search ⇒ Object (readonly)
Returns the value of attribute search.
7 8 9 |
# File 'lib/gitlab/git/finders/refs_finder.rb', line 7 def search @search end |
Instance Method Details
#execute ⇒ Object
17 18 19 20 21 22 23 |
# File 'lib/gitlab/git/finders/refs_finder.rb', line 17 def execute pattern = [prefix, search, "*"].compact.join repository.list_refs( [pattern] ) end |