Class: Embedda::Filters::Provider

Inherits:
Object
  • Object
show all
Defined in:
lib/embedda/filters/provider.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ Provider

Returns a new instance of Provider.



10
11
12
# File 'lib/embedda/filters/provider.rb', line 10

def initialize(options)
  @options = options
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



9
10
11
# File 'lib/embedda/filters/provider.rb', line 9

def options
  @options
end

Instance Method Details

#get(filter_name) ⇒ Object



14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/embedda/filters/provider.rb', line 14

def get(filter_name)
  case filter_name
  when :vimeo
    Vimeo.new(protocol, video_width, video_height, vimeo_params)
  when :youtube
    Youtube.new(protocol, video_width, video_height)
  when :soundcloud
    Soundcloud.new
  else
    raise UnknownFilter.new(filter_name)
  end
end