Class: Spina::Embeds::Vimeo
- Defined in:
- app/models/spina/embeds/vimeo.rb
Constant Summary collapse
- REGEX =
/(https?:\/\/)?(www.)?(player.)?vimeo.com\/([a-z]*\/)*([0-9]{6,11})[?]?.*/
Instance Method Summary collapse
- #id ⇒ Object
-
#remote_title ⇒ Object
Get title from Vimeo API (remote call).
- #to_trix_partial_path ⇒ Object
Methods included from TrixConversion
#to_trix_attachment, #wrap_with_embed_tag
Methods included from Spina::Embeddable
Instance Method Details
#id ⇒ Object
13 14 15 |
# File 'app/models/spina/embeds/vimeo.rb', line 13 def id REGEX.match(url).try(:[], 5) end |
#remote_title ⇒ Object
Get title from Vimeo API (remote call)
18 19 20 |
# File 'app/models/spina/embeds/vimeo.rb', line 18 def remote_title get_vimeo_json&.dig(0, "title") end |
#to_trix_partial_path ⇒ Object
22 23 24 |
# File 'app/models/spina/embeds/vimeo.rb', line 22 def to_trix_partial_path "spina/embeds/vimeos/thumbnail" end |