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.
8 9 10 11 12 |
# File 'app/finders/packages/tags_finder.rb', line 8 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.
4 5 6 |
# File 'app/finders/packages/tags_finder.rb', line 4 def package_name @package_name end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
4 5 6 |
# File 'app/finders/packages/tags_finder.rb', line 4 def params @params end |
#project ⇒ Object (readonly)
Returns the value of attribute project.
4 5 6 |
# File 'app/finders/packages/tags_finder.rb', line 4 def project @project end |
Instance Method Details
#execute ⇒ Object
14 15 16 17 18 19 20 |
# File 'app/finders/packages/tags_finder.rb', line 14 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 |