Class: Packages::Conan::PackageFinder

Inherits:
Object
  • Object
show all
Defined in:
app/finders/packages/conan/package_finder.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(current_user, params) ⇒ PackageFinder

Returns a new instance of PackageFinder.


8
9
10
11
# File 'app/finders/packages/conan/package_finder.rb', line 8

def initialize(current_user, params)
  @current_user = current_user
  @query = params[:query]
end

Instance Attribute Details

#current_userObject (readonly)

Returns the value of attribute current_user.


6
7
8
# File 'app/finders/packages/conan/package_finder.rb', line 6

def current_user
  @current_user
end

#queryObject (readonly)

Returns the value of attribute query.


6
7
8
# File 'app/finders/packages/conan/package_finder.rb', line 6

def query
  @query
end

Instance Method Details

#executeObject


13
14
15
# File 'app/finders/packages/conan/package_finder.rb', line 13

def execute
  packages_for_current_user.installable.with_name_like(query).order_name_asc if query
end