Class: Dato::Local::FieldType::Video
- Inherits:
-
Object
- Object
- Dato::Local::FieldType::Video
- Defined in:
- lib/dato/local/field_type/video.rb
Class Method Summary collapse
Instance Method Summary collapse
- #height ⇒ Object
- #iframe_embed(width = nil, height = nil) ⇒ Object
-
#initialize(attributes) ⇒ Video
constructor
A new instance of Video.
- #provider ⇒ Object
- #provider_uid ⇒ Object
- #provider_url ⇒ Object
- #thumbnail_url ⇒ Object
- #title ⇒ Object
- #url ⇒ Object
- #width ⇒ Object
Constructor Details
#initialize(attributes) ⇒ Video
Returns a new instance of Video.
13 14 15 |
# File 'lib/dato/local/field_type/video.rb', line 13 def initialize(attributes) @attributes = attributes end |
Class Method Details
.parse(value, _repo) ⇒ Object
9 10 11 |
# File 'lib/dato/local/field_type/video.rb', line 9 def self.parse(value, _repo) new(value) end |
Instance Method Details
#height ⇒ Object
33 34 35 |
# File 'lib/dato/local/field_type/video.rb', line 33 def height @attributes[:height] end |
#iframe_embed(width = nil, height = nil) ⇒ Object
49 50 51 |
# File 'lib/dato/local/field_type/video.rb', line 49 def (width = nil, height = nil) VideoEmbed.(url, { width: width, height: height }.compact) end |
#provider ⇒ Object
37 38 39 |
# File 'lib/dato/local/field_type/video.rb', line 37 def provider @attributes[:provider] end |
#provider_uid ⇒ Object
45 46 47 |
# File 'lib/dato/local/field_type/video.rb', line 45 def provider_uid @attributes[:provider_uid] end |
#provider_url ⇒ Object
41 42 43 |
# File 'lib/dato/local/field_type/video.rb', line 41 def provider_url @attributes[:provider_url] end |
#thumbnail_url ⇒ Object
21 22 23 |
# File 'lib/dato/local/field_type/video.rb', line 21 def thumbnail_url @attributes[:thumbnail_url] end |
#title ⇒ Object
25 26 27 |
# File 'lib/dato/local/field_type/video.rb', line 25 def title @attributes[:title] end |
#url ⇒ Object
17 18 19 |
# File 'lib/dato/local/field_type/video.rb', line 17 def url @attributes[:url] end |
#width ⇒ Object
29 30 31 |
# File 'lib/dato/local/field_type/video.rb', line 29 def width @attributes[:width] end |