Class: Packages::TagsFinder
- Inherits:
-
Object
- Object
- Packages::TagsFinder
- Defined in:
- app/finders/packages/tags_finder.rb
Instance Attribute Summary collapse
-
#package_name ⇒ Object
readonly
Returns the value of attribute package_name.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#project ⇒ Object
readonly
Returns the value of attribute project.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(project, package_name, params = {}) ⇒ TagsFinder
constructor
A new instance of TagsFinder.
Constructor Details
#initialize(project, package_name, params = {}) ⇒ TagsFinder
Returns a new instance of TagsFinder.
7 8 9 10 11 |
# File 'app/finders/packages/tags_finder.rb', line 7 def initialize(project, package_name, params = {}) @project = project @package_name = package_name @params = params end |
Instance Attribute Details
#package_name ⇒ Object (readonly)
Returns the value of attribute package_name.
3 4 5 |
# File 'app/finders/packages/tags_finder.rb', line 3 def package_name @package_name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'app/finders/packages/tags_finder.rb', line 3 def params @params end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
3 4 5 |
# File 'app/finders/packages/tags_finder.rb', line 3 def project @project end |
Instance Method Details
#execute ⇒ Object
13 14 15 16 17 18 19 |
# File 'app/finders/packages/tags_finder.rb', line 13 def execute packages = project.packages .with_name(package_name) packages = packages.with_package_type(package_type) if package_type.present? Packages::Tag.for_package_ids(packages.select(:id)) end |