Module: EmbeddedURL::ClassMethods
- Defined in:
- lib/embedded_url.rb
Instance Method Summary collapse
Instance Method Details
#with_embedded(field) ⇒ Object
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
# File 'lib/embedded_url.rb', line 16 def (field) define_method("embedded_#{field}") do link = send(field) begin Gist.new(link). || Youtube.new(link). || Vimeo.new(link). || SlideShare.new(link). || (link =~ /^http/ ? link : "http://#{link}") rescue end end end |