Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/embedda.rb
Instance Method Summary collapse
Instance Method Details
#embedda(options = {}) ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'lib/embedda.rb', line 4 def ( = {}) = {:filters => [:youtube, :vimeo, :soundcloud]}.merge() # Make sure that filters is an array because we allow the short form of # "hello".embedda(:filters => :youtube) instead of "hello".embedda(:filters => [:youtube]) [:filters] = Array([:filters]) compiled = self compiled = youtube_replace(compiled) if [:filters].include?(:youtube) compiled = vimeo_replace(compiled) if [:filters].include?(:vimeo) compiled = soundcloud_replace(compiled) if [:filters].include?(:soundcloud) return compiled end |