Sha256: 3970ea5ea4daaa901256b88224f7179d4885453be768b69bb140b4155538095d
Contents?: true
Size: 560 Bytes
Versions: 12
Compression:
Stored size: 560 Bytes
Contents
module ApiResource module Formats autoload :XmlFormat, 'api_resource/formats/xml_format' autoload :JsonFormat, 'api_resource/formats/json_format' # 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) ApiResource::Formats.const_get(ActiveSupport::Inflector.camelize(mime_type_reference.to_s) + "Format") end end end
Version data entries
12 entries across 12 versions & 2 rubygems