Skip to content

Instantly share code, notes, and snippets.

@mrageh
Created September 20, 2013 04:50
Show Gist options
  • Save mrageh/6633432 to your computer and use it in GitHub Desktop.
Save mrageh/6633432 to your computer and use it in GitHub Desktop.
event_reporter - adam
require "pry"
class EventReporter
def initialize
@queue = []
end
def run
input = ''
puts "Welcome EventReporter"
until input == 'quit'
puts ""
printf "enter command:"
input = gets.chomp
process_command(input)
end
end
#get the user's command and process it here
def process_command(command)
parts = command.split(" ")
input = parts[0]
case command
when 'find' then find(parts[1..-1])
when 'queue' then queue(parts[1..-1])
when 'help' then help(parts [1..-1])
when 'load' then load(parts[1..-1])
else
puts "The command you entered is invalid!"
end
end
# Given the column name and the criteria add all the found items to the queue
# find("first_name","Allison")
def find(row, value)
end
#This returns the count of all the objects in the queue
def queue_count
queue.count
end
# remove all the items in the queue
def queue_clear()
end
# print all the items in the queue
def queue_print()
end
# print all the possible commands that you can type
def help()
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment