Class: SlideHero::Media

Inherits:
Object
  • Object
show all
Defined in:
lib/slide_hero/media.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#typeObject (readonly)

Returns the value of attribute type.



3
4
5
# File 'lib/slide_hero/media.rb', line 3

def type
  @type
end

#urlObject (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

#compileObject



9
10
11
# File 'lib/slide_hero/media.rb', line 9

def compile
  %{<#{type} data-autoplay src="#{type}/#{url}"></#{type}>}
end