Class: Repositories::BranchNamesFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/repositories/branch_names_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(repository, params = {}) ⇒ BranchNamesFinder

Returns a new instance of BranchNamesFinder.



7
8
9
10
# File 'app/finders/repositories/branch_names_finder.rb', line 7

def initialize(repository, params = {})
  @repository = repository
  @params = params
end

Instance Attribute Details

#paramsObject (readonly)

Returns the value of attribute params.



5
6
7
# File 'app/finders/repositories/branch_names_finder.rb', line 5

def params
  @params
end

#repositoryObject (readonly)

Returns the value of attribute repository.



5
6
7
# File 'app/finders/repositories/branch_names_finder.rb', line 5

def repository
  @repository
end

Instance Method Details

#executeObject



12
13
14
15
16
# File 'app/finders/repositories/branch_names_finder.rb', line 12

def execute
  return unless search && offset && limit

  repository.search_branch_names(search).lazy.drop(offset).take(limit) # rubocop:disable CodeReuse/ActiveRecord
end