Class: SpreeCmCommissioner::GuestSearcherQuery
- Inherits:
-
Object
- Object
- SpreeCmCommissioner::GuestSearcherQuery
- Defined in:
- app/queries/spree_cm_commissioner/guest_searcher_query.rb
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #call ⇒ Object
- #event_id ⇒ Object
-
#initialize(params) ⇒ GuestSearcherQuery
constructor
A new instance of GuestSearcherQuery.
Constructor Details
#initialize(params) ⇒ GuestSearcherQuery
Returns a new instance of GuestSearcherQuery.
5 6 7 |
# File 'app/queries/spree_cm_commissioner/guest_searcher_query.rb', line 5 def initialize(params) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
3 4 5 |
# File 'app/queries/spree_cm_commissioner/guest_searcher_query.rb', line 3 def params @params end |
Instance Method Details
#call ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'app/queries/spree_cm_commissioner/guest_searcher_query.rb', line 11 def call return SpreeCmCommissioner::Guest.none if event_id.blank? if params[:qr_data].present? search_by_guest_qr elsif params[:term].present? search_by_term else SpreeCmCommissioner::Guest.none end end |
#event_id ⇒ Object
9 |
# File 'app/queries/spree_cm_commissioner/guest_searcher_query.rb', line 9 def event_id = params[:event_id] |