Class: SlideHero::Media
- Inherits:
-
Object
- Object
- SlideHero::Media
- Defined in:
- lib/slide_hero/media.rb
Instance Attribute Summary collapse
-
#type ⇒ Object
readonly
Returns the value of attribute type.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Instance Method Summary collapse
- #compile ⇒ Object
-
#initialize(url, type: :video) ⇒ Media
constructor
A new instance of Media.
Constructor Details
#initialize(url, type: :video) ⇒ Media
Returns a new instance of Media.
4 5 6 7 |
# File 'lib/slide_hero/media.rb', line 4 def initialize(url, type: :video) @url = url @type = type end |
Instance Attribute Details
#type ⇒ Object (readonly)
Returns the value of attribute type.
3 4 5 |
# File 'lib/slide_hero/media.rb', line 3 def type @type end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
3 4 5 |
# File 'lib/slide_hero/media.rb', line 3 def url @url end |
Instance Method Details
#compile ⇒ Object
9 10 11 |
# File 'lib/slide_hero/media.rb', line 9 def compile %{<#{type} data-autoplay src="#{type}/#{url}"></#{type}>} end |