Skip to content

Instantly share code, notes, and snippets.

View ovargas27's full-sized avatar

Omar ovargas27

  • Regalii
  • Toluca, Mex
View GitHub Profile
require './user.rb'
def mainmenu
puts 'select an option please
1.- new user
2.- delete user
3.- consult user
4.- exit
type a number: '
# Given a time ordered list of pageviews ("events"),
# determine how many "visits" each user had,
# how long each visit lasted and how many page views occurred during each visit.
# A visit ends when the user has not had another page view for 1 hour,
# a new pageview after 1 hours starts a new visit (the time between visits is 1 hour).
require 'enumerator'
class Array
def to_event
class User < ActiveRecord::Base
has_many :tasks
#common attributes and behavior for managers and workers
end
class Manager < User
#special manager's attributes and behavior
end
class Worker < User