Class: BlgrLib::ReservationQuery::ConfigBuilder

Inherits:
Object
  • Object
show all
Defined in:
lib/blgr_lib/reservation_query.rb

Overview

Builder config when instantiating ReservationQuery class

Don't use this class directly

Instance Method Summary collapse

Instance Method Details

#collect_activeObject

filter by active reservations only



238
239
240
# File 'lib/blgr_lib/reservation_query.rb', line 238

def collect_active
  config['active'] = true
end

#collect_inactiveObject

filer by inactive reservations only



247
248
249
# File 'lib/blgr_lib/reservation_query.rb', line 247

def collect_inactive
  config['active'] = false
end

#commission_status=(commission_status) ⇒ Object



310
311
312
# File 'lib/blgr_lib/reservation_query.rb', line 310

def commission_status=(commission_status)
  config['commission_status'] = commission_status
end

#date=(date) ⇒ Object

filter by date equal given argument

Parameters:

  • date (Date)


306
307
308
# File 'lib/blgr_lib/reservation_query.rb', line 306

def date=(date)
  config['date_eq'] = date
end

#end_date=(date) ⇒ Object

filter by end_date

Parameters:

  • date (Date, #iso8601)


261
262
263
# File 'lib/blgr_lib/reservation_query.rb', line 261

def end_date=(date)
  config['end_date'] = date.iso8601
end

#end_of_created_date=(date) ⇒ Object

filter by end_of_created_date

Parameters:

  • date (Date, #iso8601)


275
276
277
# File 'lib/blgr_lib/reservation_query.rb', line 275

def end_of_created_date=(date)
  config['end_of_created_date'] = date.iso8601
end

#remove_no_showObject



242
243
244
# File 'lib/blgr_lib/reservation_query.rb', line 242

def remove_no_show
  config['remove_no_show'] = true
end

#reservation_id_like=(id) ⇒ Object

filter by reservation id like given argument this will use '%id%' query

Parameters:

  • id (String)


299
300
301
# File 'lib/blgr_lib/reservation_query.rb', line 299

def reservation_id_like=(id)
  config['reservation_id_like'] = id
end

#reservation_status=(reservation_status) ⇒ Object



314
315
316
# File 'lib/blgr_lib/reservation_query.rb', line 314

def reservation_status=(reservation_status)
  config['reservation_status'] = reservation_status
end

#restaurant_ids=(ids) ⇒ Object

filter by restaurant id

Parameters:

  • ids (Integer)
  • ids (Array)

    array of integer or string



283
284
285
# File 'lib/blgr_lib/reservation_query.rb', line 283

def restaurant_ids=(ids)
  config['restaurant_ids'] = Array(ids).flatten if ids.present?
end

#restaurant_name_like=(name) ⇒ Object

filter by restaurant name like given argument this will use '%name%' query

Parameters:

  • name (String)


291
292
293
# File 'lib/blgr_lib/reservation_query.rb', line 291

def restaurant_name_like=(name)
  config['restaurant_name_like'] = name
end

#start_date=(date) ⇒ Object

filter by start_date

Parameters:

  • date (Date, #iso8601)


254
255
256
# File 'lib/blgr_lib/reservation_query.rb', line 254

def start_date=(date)
  config['start_date'] = date.iso8601
end

#start_of_created_date=(date) ⇒ Object

filter by start_of_created_date

Parameters:

  • date (Date, #iso8601)


268
269
270
# File 'lib/blgr_lib/reservation_query.rb', line 268

def start_of_created_date=(date)
  config['start_of_created_date'] = date.iso8601
end