Sha256: e9adbc2845e20ddc11d08a8e587b2a9de3e91e4212955482baccd75340c6c8f7
Contents?: true
Size: 1022 Bytes
Versions: 14
Compression:
Stored size: 1022 Bytes
Contents
# frozen_string_literal: true require 'active_support/core_ext/hash/compact' require 'video_embed' module Dato module Local module FieldType class Video def self.parse(value, _repo) new(value) end def initialize(attributes) @attributes = attributes end def url @attributes[:url] end def thumbnail_url @attributes[:thumbnail_url] end def title @attributes[:title] end def width @attributes[:width] end def height @attributes[:height] end def provider @attributes[:provider] end def provider_url @attributes[:provider_url] end def provider_uid @attributes[:provider_uid] end def iframe_embed(width = nil, height = nil) VideoEmbed.embed(url, { width: width, height: height }.compact) end end end end end
Version data entries
14 entries across 14 versions & 1 rubygems