Class: PassSaleSearch

Inherits:
Object
  • Object
show all
Includes:
SearchByDates
Defined in:
app/models/pass_sale_search.rb

Instance Attribute Summary collapse

Attributes included from SearchByDates

#organization, #start, #stop

Instance Method Summary collapse

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_typeObject (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

#resultsObject



15
16
17
# File 'app/models/pass_sale_search.rb', line 15

def results
  @results ||= Order.pass_sale_search(self).select(&:has_pass?)
end