Class: AreWeThereYet::Run

Inherits:
Object
  • Object
show all
Defined in:
lib/are_we_there_yet/run.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#idObject (readonly)

Returns the value of attribute id.



3
4
5
# File 'lib/are_we_there_yet/run.rb', line 3

def id
  @id
end

Instance Method Details

#finish(database) ⇒ Object



8
9
10
# File 'lib/are_we_there_yet/run.rb', line 8

def finish(database)
  database[:runs].where(:id => id).update(:ended_at => Time.now.utc)
end

#start(database) ⇒ Object



4
5
6
# File 'lib/are_we_there_yet/run.rb', line 4

def start(database)
  @id = database[:runs].insert(:started_at => Time.now.utc)
end