class Rbvore::Ticket

Attributes

auto_send[RW]
fire_date[RW]
fire_time[RW]
guest_count[RW]
id[RW]
location_id[RW]
name[RW]
open[RW]
pos_id[RW]
ready_date[RW]
ready_time[RW]
ticket_number[RW]
totals[RW]
void[RW]

Public Class Methods

build_where_clause(open: nil, table_id: nil) click to toggle source
# File lib/rbvore/ticket.rb, line 31
def self.build_where_clause(open: nil, table_id: nil) # rubocop:disable Metrics/CyclomaticComplexity
  case
  when !open.nil? && table_id.nil?
    { where: "eq(open,#{open})" }
  when open.nil? && !table_id.nil?
    { where: "eq(@table.id,'#{table_id}')" }
  when !open.nil? && !table_id.nil?
    { where: "and(eq(open,#{open}),eq(@table.id,'#{table_id}'))" }
  end
end
fetch_all(location_id:, open: nil, table_id: nil, api_key: nil) click to toggle source
Calls superclass method
# File lib/rbvore/ticket.rb, line 23
def self.fetch_all(location_id:, open: nil, table_id: nil, api_key: nil)
  super(
    location_id: location_id,
    params: build_where_clause(open: open, table_id: table_id),
    api_key: api_key,
  )
end
new(hash) click to toggle source
# File lib/rbvore/ticket.rb, line 42
def initialize(hash)
  set_attributes(hash)
end