This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require './user.rb' | |
def mainmenu | |
puts 'select an option please | |
1.- new user | |
2.- delete user | |
3.- consult user | |
4.- exit | |
type a number: ' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
NewerOlder