Class: BirdFeed::Format
- Inherits:
-
Object
- Object
- BirdFeed::Format
- Defined in:
- lib/birdfeed/format.rb
Constant Summary collapse
- @@registered_formats =
[]
Class Method Summary collapse
-
.detect(content) ⇒ Object
Grab all of the sub classes and work our way up…
-
.register(format) ⇒ Object
Add a format to the registered formats list.
-
.registered_formats ⇒ Object
Return a list of formats available in BirdFeed.
Class Method Details
.detect(content) ⇒ Object
Grab all of the sub classes and work our way up…
7 8 9 10 11 |
# File 'lib/birdfeed/format.rb', line 7 def detect(content) @@registered_formats.detect do |format| format.valid?(content) end end |
.register(format) ⇒ Object
Add a format to the registered formats list.
14 15 16 |
# File 'lib/birdfeed/format.rb', line 14 def register(format) @@registered_formats << format end |
.registered_formats ⇒ Object
Return a list of formats available in BirdFeed
19 20 21 |
# File 'lib/birdfeed/format.rb', line 19 def registered_formats @@registered_formats end |