Class: Timelogs::TimelogsFinder
- Inherits:
-
Object
- Object
- Timelogs::TimelogsFinder
- Defined in:
- app/finders/timelogs/timelogs_finder.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#parent ⇒ Object
readonly
Returns the value of attribute parent.
Instance Method Summary collapse
- #execute ⇒ Object
-
#initialize(parent, params = {}) ⇒ TimelogsFinder
constructor
A new instance of TimelogsFinder.
Constructor Details
#initialize(parent, params = {}) ⇒ TimelogsFinder
Returns a new instance of TimelogsFinder.
7 8 9 10 |
# File 'app/finders/timelogs/timelogs_finder.rb', line 7 def initialize(parent, params = {}) @parent = parent @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
5 6 7 |
# File 'app/finders/timelogs/timelogs_finder.rb', line 5 def params @params end |
#parent ⇒ Object (readonly)
Returns the value of attribute parent.
5 6 7 |
# File 'app/finders/timelogs/timelogs_finder.rb', line 5 def parent @parent end |
Instance Method Details
#execute ⇒ Object
12 13 14 15 16 17 18 19 |
# File 'app/finders/timelogs/timelogs_finder.rb', line 12 def execute timelogs = parent&.timelogs || Timelog.all timelogs = by_time(timelogs) timelogs = by_user(timelogs) timelogs = by_group(timelogs) timelogs = by_project(timelogs) apply_sorting(timelogs) end |