Class: Refinery::Videos::Video

Inherits:
Core::BaseModel
  • Object
show all
Extended by:
FriendlyId
Defined in:
app/models/refinery/videos/video.rb

Defined Under Namespace

Classes: Translation

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#localeObject

to hold temporarily



25
26
27
# File 'app/models/refinery/videos/video.rb', line 25

def locale
  @locale
end

#video_dataObject

Returns the value of attribute video_data.



6
7
8
# File 'app/models/refinery/videos/video.rb', line 6

def video_data
  @video_data
end

Instance Method Details

#embed_html_with_dimensionsObject



59
60
61
# File 'app/models/refinery/videos/video.rb', line 59

def embed_html_with_dimensions
  self.width && self.height ? self.embed_html(self.width, self.height) : self.embed_html
end

#friendly_id_sourceObject



38
39
40
# File 'app/models/refinery/videos/video.rb', line 38

def friendly_id_source
  custom_url.presence || title
end

#initialize_attributesObject



42
43
44
# File 'app/models/refinery/videos/video.rb', line 42

def initialize_attributes
  self.load_video_data
end

#load_video_dataObject



46
47
48
# File 'app/models/refinery/videos/video.rb', line 46

def load_video_data
  self.video_data = self.video_url.blank? ? nil : (UnvlogIt.new(self.video_url) rescue nil)
end

#set_title_from_videoObject



55
56
57
# File 'app/models/refinery/videos/video.rb', line 55

def set_title_from_video
  self.title = self.video_data.title unless self.video_data.blank?
end

#video_url=(video_url) ⇒ Object



50
51
52
53
# File 'app/models/refinery/videos/video.rb', line 50

def video_url= video_url
  self[:video_url] = video_url
  self.load_video_data
end