你起码得给个strucutre吧。。比如你有什么object干什么之类的
class journal
attr_accessor
:start_time
def initialize
#your code....
@start_time = Time.now
end
def edit
if timeout
#cannot change your journal, return
return false
end
....
end
def timeout
if Time.now - @start_time > 48*24*3600
#ruby use second as standard unit for time
return true
end
return false
end
end