class OmnivoreIO::TicketItem

Public Class Methods

new(attributes={}) click to toggle source
# File lib/omnivore-io/api/ticket.rb, line 7
def initialize(attributes={})
  self.quantity = attributes['quantity']
  self.sent = attributes['sent']
  self.menu_item = OmnivoreIO::MenuItem.new(nil, attributes['_embedded']['menu_item'])
  self.modifiers = (attributes['modifiers'] || []).map{|modifier_json| OmnivoreIO::Modifier.new(nil, modifier_json) }
end

Public Instance Methods

as_json(options={}) click to toggle source
Calls superclass method
# File lib/omnivore-io/api/ticket.rb, line 14
def as_json(options={})
  json = super
  json[:menu_item] = self.menu_item.as_json
  json
end