Upgraded Rails and RSpec
[monkeycharger.git] / vendor / rails / activeresource / lib / active_resource / formats.rb
blob28864cf588f528f4b8381c7772aa0c7a827b2724
1 module ActiveResource
2   module Formats
3     # Lookup the format class from a mime type reference symbol. Example:
4     #
5     #   ActiveResource::Formats[:xml]  # => ActiveResource::Formats::XmlFormat
6     #   ActiveResource::Formats[:json] # => ActiveResource::Formats::JsonFormat
7     def self.[](mime_type_reference)
8       ActiveResource::Formats.const_get(mime_type_reference.to_s.camelize + "Format")
9     end
10   end
11 end
13 require 'active_resource/formats/xml_format'
14 require 'active_resource/formats/json_format'