Class: Boards::VisitsFinder
- Inherits:
-
Object
- Object
- Boards::VisitsFinder
- Defined in:
- app/finders/boards/visits_finder.rb
Instance Attribute Summary collapse
-
#current_user ⇒ Object
Returns the value of attribute current_user.
-
#params ⇒ Object
Returns the value of attribute params.
-
#parent ⇒ Object
Returns the value of attribute parent.
Instance Method Summary collapse
- #execute(count = nil) ⇒ Object (also: #latest)
-
#initialize(parent, current_user) ⇒ VisitsFinder
constructor
A new instance of VisitsFinder.
Constructor Details
#initialize(parent, current_user) ⇒ VisitsFinder
Returns a new instance of VisitsFinder.
7 8 9 10 |
# File 'app/finders/boards/visits_finder.rb', line 7 def initialize(parent, current_user) @current_user = current_user @parent = parent end |
Instance Attribute Details
#current_user ⇒ Object
Returns the value of attribute current_user.
5 6 7 |
# File 'app/finders/boards/visits_finder.rb', line 5 def current_user @current_user end |
#params ⇒ Object
Returns the value of attribute params.
5 6 7 |
# File 'app/finders/boards/visits_finder.rb', line 5 def params @params end |
#parent ⇒ Object
Returns the value of attribute parent.
5 6 7 |
# File 'app/finders/boards/visits_finder.rb', line 5 def parent @parent end |
Instance Method Details
#execute(count = nil) ⇒ Object Also known as: latest
12 13 14 15 16 |
# File 'app/finders/boards/visits_finder.rb', line 12 def execute(count = nil) return unless current_user recent_visit_model.latest(current_user, parent, count: count) end |