Class: KnowledgeBase::Sectionables::Video

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

Constant Summary collapse

VIDEO_ID_EXPRESSION =
%r{^https?://(?:(?:www|m)\.)?youtube\.com/watch\?v=([^&]+)}

Instance Method Summary collapse

Instance Method Details

#youtube_idObject



5
6
7
# File 'app/models/knowledge_base/sectionables/video.rb', line 5

def youtube_id
  url[VIDEO_ID_EXPRESSION, 1]
end