Class: Video

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

Instance Method Summary collapse

Instance Method Details

#lengthObject



10
11
12
13
14
15
# File 'app/models/video.rb', line 10

def length
  return "0:00" if duration.blank?
  minutes = duration / 60
  seconds = duration % 60
  "#{minutes}:#{seconds.to_s.rjust(2,'0')}"
end


17
18
19
# File 'app/models/video.rb', line 17

def permalink
  friendly_id
end

#to_sObject



21
22
23
# File 'app/models/video.rb', line 21

def to_s
  title
end