Class: ApiView::Registry
- Inherits:
-
Object
- Object
- ApiView::Registry
- Defined in:
- lib/api_view/registry.rb
Class Method Summary collapse
- .add_model(model, converter) ⇒ Object
- .converter_for(clazz, options = nil) ⇒ Object
- .models ⇒ Object
Class Method Details
.add_model(model, converter) ⇒ Object
8 9 10 |
# File 'lib/api_view/registry.rb', line 8 def add_model(model, converter) models[model.to_s] = converter end |
.converter_for(clazz, options = nil) ⇒ Object
12 13 14 15 16 17 |
# File 'lib/api_view/registry.rb', line 12 def converter_for(clazz, =nil) if && [:use].kind_of?(Class) then return [:use] end models[clazz.to_s] || ApiView::Default end |
.models ⇒ Object
4 5 6 |
# File 'lib/api_view/registry.rb', line 4 def models @models ||= {} end |