Class: Movie

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

Instance Method Summary collapse

Instance Method Details

#content(option = :normal) ⇒ Object



8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
# File 'app/models/movie.rb', line 8

def content(option=:normal)
  case true
    when option == :mini
      width = "100"
      height = "60"
    when option  == :normal
      width = self.movie_site.width.to_s
      height = self.movie_site.height.to_s
  else
      width = self.movie_site.width.to_s
      height = self.movie_site.height.to_s
  end
  self.movie_site.embed.gsub("[[WIDTH]]",width).gsub("[[HEIGHT]]",height).gsub("[[KEYWORD]]",self.keyword)

end