module Tickethub::Formats
Constants
- JsonFormat
- MAPPING
Public Class Methods
[](mime_type_reference)
click to toggle source
Lookup the format class from a mime type reference symbol. Example:
Tickethub::Formats[:json] # => Tickethub::Formats::JsonFormat
# File lib/tickethub/formats.rb, line 26 def self.[](mime_type_reference) Tickethub::Formats.const_get(Helpers.camelize(mime_type_reference.to_s) + 'Format') end
for(type)
click to toggle source
# File lib/tickethub/formats.rb, line 18 def self.for(type) format = MAPPING[type] format && self[format] end