Class: Embedit::Provider
- Inherits:
-
Object
- Object
- Embedit::Provider
- Defined in:
- lib/embedit/provider.rb
Constant Summary collapse
- @@list =
require all providers and collect the names
Dir["#{File.dirname(__FILE__)}/providers/*.rb"].collect {|file| require(file); "Embedit::#{File.basename(file,'.rb').classify}".constantize }
Instance Attribute Summary collapse
-
#format ⇒ Object
readonly
Returns the value of attribute format.
-
#html ⇒ Object
readonly
Returns the value of attribute html.
-
#title ⇒ Object
readonly
Returns the value of attribute title.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
Class Method Summary collapse
Instance Attribute Details
#format ⇒ Object (readonly)
Returns the value of attribute format.
5 6 7 |
# File 'lib/embedit/provider.rb', line 5 def format @format end |
#html ⇒ Object (readonly)
Returns the value of attribute html.
5 6 7 |
# File 'lib/embedit/provider.rb', line 5 def html @html end |
#title ⇒ Object (readonly)
Returns the value of attribute title.
5 6 7 |
# File 'lib/embedit/provider.rb', line 5 def title @title end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
5 6 7 |
# File 'lib/embedit/provider.rb', line 5 def url @url end |
Class Method Details
.all ⇒ Object
11 12 13 |
# File 'lib/embedit/provider.rb', line 11 def all @@list end |
.each ⇒ Object
15 16 17 18 19 |
# File 'lib/embedit/provider.rb', line 15 def each all.each do |provider| yield provider end end |
.find(url) ⇒ Object
21 22 23 24 25 26 |
# File 'lib/embedit/provider.rb', line 21 def find(url) each do |provider| return provider.new(url) if provider.match(url) end nil # if no provider found end |