X-Git-Url: https://git.njae.me.uk/?a=blobdiff_plain;f=vendor%2Frails%2Factiveresource%2Flib%2Factive_resource%2Fformats.rb;fp=vendor%2Frails%2Factiveresource%2Flib%2Factive_resource%2Fformats.rb;h=28864cf588f528f4b8381c7772aa0c7a827b2724;hb=437aa336c44c74a30aeea16a06743c32747ed661;hp=0000000000000000000000000000000000000000;hpb=97a0772b06264134cfe38e7494f9427efe0840a0;p=feedcatcher.git diff --git a/vendor/rails/activeresource/lib/active_resource/formats.rb b/vendor/rails/activeresource/lib/active_resource/formats.rb new file mode 100644 index 0000000..28864cf --- /dev/null +++ b/vendor/rails/activeresource/lib/active_resource/formats.rb @@ -0,0 +1,14 @@ +module ActiveResource + module Formats + # Lookup the format class from a mime type reference symbol. Example: + # + # ActiveResource::Formats[:xml] # => ActiveResource::Formats::XmlFormat + # ActiveResource::Formats[:json] # => ActiveResource::Formats::JsonFormat + def self.[](mime_type_reference) + ActiveResource::Formats.const_get(mime_type_reference.to_s.camelize + "Format") + end + end +end + +require 'active_resource/formats/xml_format' +require 'active_resource/formats/json_format' \ No newline at end of file