Class: SaleSearch
- Inherits:
-
Object
- Object
- SaleSearch
- Includes:
- SearchByDates
- Defined in:
- app/models/sale_search.rb
Instance Attribute Summary collapse
-
#event ⇒ Object
readonly
Returns the value of attribute event.
-
#show ⇒ Object
readonly
Returns the value of attribute show.
Attributes included from SearchByDates
Instance Method Summary collapse
-
#initialize(terms) ⇒ SaleSearch
constructor
A new instance of SaleSearch.
- #results ⇒ Object
Methods included from SearchByDates
#default_start, #default_stop, #start_with, #stop_with
Constructor Details
#initialize(terms) ⇒ SaleSearch
Returns a new instance of SaleSearch.
6 7 8 9 10 11 12 13 14 |
# File 'app/models/sale_search.rb', line 6 def initialize(terms) @organization = terms[:organization] @event = terms[:event] @show = terms[:show] @start = start_with(terms[:start]) @stop = stop_with(terms[:stop]) @results = yield(results) if block_given? end |
Instance Attribute Details
#event ⇒ Object (readonly)
Returns the value of attribute event.
4 5 6 |
# File 'app/models/sale_search.rb', line 4 def event @event end |
#show ⇒ Object (readonly)
Returns the value of attribute show.
4 5 6 |
# File 'app/models/sale_search.rb', line 4 def show @show end |
Instance Method Details
#results ⇒ Object
16 17 18 |
# File 'app/models/sale_search.rb', line 16 def results @results ||= Order.sale_search(self).select(&:has_ticket?) end |