Class: Refinery::Videos::Video
- Inherits:
-
Core::BaseModel
- Object
- Core::BaseModel
- Refinery::Videos::Video
- Extended by:
- FriendlyId
- Defined in:
- app/models/refinery/videos/video.rb
Defined Under Namespace
Classes: Translation
Instance Attribute Summary collapse
-
#locale ⇒ Object
to hold temporarily.
-
#video_data ⇒ Object
Returns the value of attribute video_data.
Instance Method Summary collapse
- #embed_html_with_dimensions ⇒ Object
- #friendly_id_source ⇒ Object
- #initialize_attributes ⇒ Object
- #load_video_data ⇒ Object
- #set_title_from_video ⇒ Object
- #video_url=(video_url) ⇒ Object
Instance Attribute Details
#locale ⇒ Object
to hold temporarily
25 26 27 |
# File 'app/models/refinery/videos/video.rb', line 25 def locale @locale end |
#video_data ⇒ Object
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_dimensions ⇒ Object
59 60 61 |
# File 'app/models/refinery/videos/video.rb', line 59 def self.width && self.height ? self.(self.width, self.height) : self. end |
#friendly_id_source ⇒ Object
38 39 40 |
# File 'app/models/refinery/videos/video.rb', line 38 def friendly_id_source custom_url.presence || title end |
#initialize_attributes ⇒ Object
42 43 44 |
# File 'app/models/refinery/videos/video.rb', line 42 def initialize_attributes self.load_video_data end |
#load_video_data ⇒ Object
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_video ⇒ Object
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 |