Sha256: 1f2382462b3eeec46c89ca2c37e6f012d456ee9df39eefa8fff5457ff14376e7

Contents?: true

Size: 572 Bytes

Versions: 45

Compression:

Stored size: 572 Bytes

Contents

module ActiveResource
  module Formats
    autoload :XmlFormat, 'active_resource/formats/xml_format'
    autoload :JsonFormat, 'active_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)
      ActiveResource::Formats.const_get(ActiveSupport::Inflector.camelize(mime_type_reference.to_s) + "Format")
    end
  end
end

Version data entries

45 entries across 45 versions & 1 rubygems

Version Path
activeresource-3.0.20 lib/active_resource/formats.rb
activeresource-3.0.19 lib/active_resource/formats.rb
activeresource-3.0.18 lib/active_resource/formats.rb
activeresource-3.0.17 lib/active_resource/formats.rb
activeresource-3.0.16 lib/active_resource/formats.rb
activeresource-3.0.15 lib/active_resource/formats.rb
activeresource-3.0.14 lib/active_resource/formats.rb
activeresource-3.0.13 lib/active_resource/formats.rb
activeresource-3.0.13.rc1 lib/active_resource/formats.rb
activeresource-3.0.12 lib/active_resource/formats.rb
activeresource-3.0.12.rc1 lib/active_resource/formats.rb
activeresource-3.0.11 lib/active_resource/formats.rb
activeresource-3.0.10 lib/active_resource/formats.rb
activeresource-3.0.10.rc1 lib/active_resource/formats.rb
activeresource-3.0.9 lib/active_resource/formats.rb
activeresource-3.0.9.rc5 lib/active_resource/formats.rb
activeresource-3.0.9.rc4 lib/active_resource/formats.rb
activeresource-3.0.9.rc3 lib/active_resource/formats.rb
activeresource-3.0.9.rc1 lib/active_resource/formats.rb
activeresource-3.0.8 lib/active_resource/formats.rb