Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: 6a62245e01
Fetching contributors…

Cannot retrieve contributors at this time

33 lines (27 sloc) 0.96 kb
module Nestful
module Formats
class Format
def extension
end
def mime_type
end
def encode(*args)
end
def decode(*args)
end
end
autoload :BlankFormat, 'nestful/formats/blank_format'
autoload :TextFormat, 'nestful/formats/text_format'
autoload :MultipartFormat, 'nestful/formats/multipart_format'
autoload :FormFormat, 'nestful/formats/form_format'
autoload :XmlFormat, 'nestful/formats/xml_format'
autoload :JsonFormat, 'nestful/formats/json_format'
# Lookup the format class from a mime type reference symbol. Example:
#
# Nestful::Formats[:xml] # => Nestful::Formats::XmlFormat
# Nestful::Formats[:json] # => Nestful::Formats::JsonFormat
def self.[](mime_type_reference)
Nestful::Formats.const_get(ActiveSupport::Inflector.camelize(mime_type_reference.to_s) + "Format")
end
end
end
Jump to Line
Something went wrong with that request. Please try again.