Class: Workarea::Storefront::ContentBlocks::VideoViewModel
Instance Method Summary
collapse
#asset_alt_text, #assets, #find_asset, #partial, #series, wrap
Instance Method Details
#embed ⇒ Object
16
17
18
19
20
21
22
23
|
# File 'app/view_models/workarea/storefront/content_blocks/video_view_model.rb', line 16
def embed
raw_embed
.gsub(
/<iframe/,
"<iframe title='#{t('workarea.storefront.content_blocks.video', url: video_url)}'"
)
.gsub(/ frameborder=["'][^"']*["']/, '')
end
|
#frame_styles ⇒ Object
12
13
14
|
# File 'app/view_models/workarea/storefront/content_blocks/video_view_model.rb', line 12
def frame_styles
aspect_ratio.present? ? "padding-bottom: #{aspect_ratio}%; height: 0;" : nil
end
|
#locals ⇒ Object
5
6
7
8
9
10
|
# File 'app/view_models/workarea/storefront/content_blocks/video_view_model.rb', line 5
def locals
super.merge(
frame_styles: frame_styles,
embed: embed
)
end
|