Sha256: a4502475a95be1ee9e8309ac8a0402d6c18a6289209a1ac3e3976df5b4856f3f
Contents?: true
Size: 510 Bytes
Versions: 99
Compression:
Stored size: 510 Bytes
Contents
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'
Version data entries
99 entries across 96 versions & 15 rubygems