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