Class: PostHotlinkedMedia
- Inherits:
-
ActiveRecord::Base
- Object
- ActiveRecord::Base
- PostHotlinkedMedia
- Defined in:
- app/models/post_hotlinked_media.rb
Class Method Summary collapse
Class Method Details
.normalize_src(src, reset_scheme: true) ⇒ Object
14 15 16 17 18 19 20 21 |
# File 'app/models/post_hotlinked_media.rb', line 14 def self.normalize_src(src, reset_scheme: true) uri = Addressable::URI.heuristic_parse(src) uri.normalize! uri.scheme = nil if reset_scheme uri.to_s rescue URI::Error, Addressable::URI::InvalidURIError src end |