Class: Period

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
app/models/period.rb

Overview

This represents a range of time.

Schema Information

Table name: periods

id         :integer          not null, primary key
starts_at  :datetime         not null
created_at :datetime         not null
updated_at :datetime         not null
ends_at    :datetime         not null

Instance Method Summary (collapse)

Instance Method Details

- (Object) length

This represents the Period's length in minutes.



23
24
25
# File 'app/models/period.rb', line 23

def length
  (ends_at - starts_at) / 1.minute
end