Class: Apical::ContentType
- Inherits:
-
Object
- Object
- Apical::ContentType
show all
- Defined in:
- lib/apical/content_types.rb
Class Method Summary
collapse
Class Method Details
.[](format) ⇒ Object
5
6
7
8
9
10
11
|
# File 'lib/apical/content_types.rb', line 5
def self.[](format)
@@registry ||= {}
klass = @@registry[format]
raise "Content type '#{format}' does not exist." unless klass
klass.new
end
|
13
14
15
16
17
|
# File 'lib/apical/content_types.rb', line 13
def self.format(format)
@format = format
@@registry ||= {}
@@registry[format] = self
end
|