Module: Onebox::Engine::StandardEmbed
- Included in:
- AllowlistedGenericOnebox, AnimatedImageOnebox, AsciinemaOnebox, AudioComOnebox, AudioboomOnebox, BandCampOnebox, CloudAppOnebox, CoubOnebox, DiscourseTopicOnebox, FacebookMediaOnebox, FiveHundredPxOnebox, FlickrOnebox, FlickrShortenedOnebox, GithubFolderOnebox, GoogleDocsOnebox, GoogleDriveOnebox, GooglePhotosOnebox, ImgurOnebox, InstagramOnebox, KalturaOnebox, LoomOnebox, MixcloudOnebox, MotokoOnebox, RedditMediaOnebox, ReplitOnebox, SimplecastOnebox, SketchFabOnebox, SlidesOnebox, SoundCloudOnebox, SpotifyOnebox, SteamStoreOnebox, TiktokOnebox, TrelloOnebox, VimeoOnebox, WistiaOnebox, YoutubeOnebox
- Defined in:
- lib/onebox/engine/standard_embed.rb
Class Method Summary collapse
- .add_oembed_provider(regexp, endpoint) ⇒ Object
- .add_opengraph_provider(regexp) ⇒ Object
- .oembed_providers ⇒ Object
- .opengraph_providers ⇒ Object
Instance Method Summary collapse
Class Method Details
.add_oembed_provider(regexp, endpoint) ⇒ Object
16 17 18 |
# File 'lib/onebox/engine/standard_embed.rb', line 16 def self.(regexp, endpoint) [regexp] = endpoint end |
.add_opengraph_provider(regexp) ⇒ Object
24 25 26 |
# File 'lib/onebox/engine/standard_embed.rb', line 24 def self.add_opengraph_provider(regexp) opengraph_providers << regexp end |
.oembed_providers ⇒ Object
12 13 14 |
# File 'lib/onebox/engine/standard_embed.rb', line 12 def self. @@oembed_providers ||= {} end |
.opengraph_providers ⇒ Object
20 21 22 |
# File 'lib/onebox/engine/standard_embed.rb', line 20 def self.opengraph_providers @@opengraph_providers ||= [] end |
Instance Method Details
#always_https? ⇒ Boolean
36 37 38 |
# File 'lib/onebox/engine/standard_embed.rb', line 36 def always_https? AllowlistedGenericOnebox.host_matches(uri, AllowlistedGenericOnebox.https_hosts) || super end |
#raw ⇒ Object
40 41 42 43 44 45 46 47 48 49 50 51 52 53 |
# File 'lib/onebox/engine/standard_embed.rb', line 40 def raw return @raw if defined?(@raw) @raw = {} set_opengraph_data_on_raw set_twitter_data_on_raw set_json_ld_data_on_raw set_favicon_data_on_raw set_description_on_raw @raw end |