Class: Workarea::Storefront::ProductVideoViewModel
- Inherits:
-
ApplicationViewModel
- Object
- ApplicationViewModel
- Workarea::Storefront::ProductVideoViewModel
- Defined in:
- app/view_models/workarea/storefront/product_video_view_model.rb
Instance Method Summary collapse
Instance Method Details
#iframe_attrs ⇒ Object
4 5 6 7 8 9 10 11 12 13 14 15 16 17 |
# File 'app/view_models/workarea/storefront/product_video_view_model.rb', line 4 def iframe_attrs attrs = { id: model., frameborder: "0", allowfullscreen: "", container_style: "padding-bottom: #{model.aspect_ratio}%" } if vimeo? attrs.merge(vimeo_attrs) elsif youtube? attrs.merge(youtube_attrs) end end |
#thumbnail ⇒ Object
19 20 21 22 |
# File 'app/view_models/workarea/storefront/product_video_view_model.rb', line 19 def thumbnail return unless model.thumbnail.present? @thumbnail ||= Workarea::Content::Asset.find_or_initialize_by(id: model.thumbnail) end |