Class: Did::Span

Inherits:
ActiveRecord::Base
  • Object
show all
Defined in:
lib/did/span.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find_for_day(date) ⇒ Object



12
13
14
# File 'lib/did/span.rb', line 12

def self.find_for_day(date)
  Span.find(:all, :conditions => ["end_time >= ? AND start_time <= ?", date, date + 1.day], :order => :start_time)
end

Instance Method Details

#durationObject



16
17
18
# File 'lib/did/span.rb', line 16

def duration
  end_time - start_time
end

#entire_sitting?Boolean

Returns:

  • (Boolean)


8
9
10
# File 'lib/did/span.rb', line 8

def entire_sitting?
  sitting_start? && sitting_end?
end

#include?(tag) ⇒ Boolean

Returns:

  • (Boolean)


20
21
22
# File 'lib/did/span.rb', line 20

def include?(tag)
  tags.include? tag
end