Class: Invoicexpress::Models::Filter
- Includes:
- HappyMapper
- Defined in:
- lib/invoicexpress/models/filter.rb
Instance Method Summary collapse
-
#initialize(args = {}) ⇒ Filter
constructor
A new instance of Filter.
Constructor Details
#initialize(args = {}) ⇒ Filter
Returns a new instance of Filter.
32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 |
# File 'lib/invoicexpress/models/filter.rb', line 32 def initialize(args = {}) if args[:status] && args[:status].is_a?(Array) o = FilterStatus.new o. = [] o. = args[:status].map(&:to_s) self.status = o end if args[:by_type] && args[:by_type].is_a?(Array) o = FilterByType.new o. = [] o. = args[:by_type].map(&:to_s) self.by_type = o end if args[:archived] && args[:archived].is_a?(Array) o = FilterArchived.new o. = [] o. = args[:archived].map(&:to_s) self.archived = o end end |