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.8.rc4 lib/active_resource/formats.rb
activeresource-3.0.8.rc2 lib/active_resource/formats.rb
activeresource-3.0.8.rc1 lib/active_resource/formats.rb
activeresource-3.1.0.beta1 lib/active_resource/formats.rb
activeresource-3.0.7 lib/active_resource/formats.rb
activeresource-3.0.7.rc2 lib/active_resource/formats.rb
activeresource-3.0.7.rc1 lib/active_resource/formats.rb
activeresource-3.0.6 lib/active_resource/formats.rb
activeresource-3.0.6.rc2 lib/active_resource/formats.rb
activeresource-3.0.6.rc1 lib/active_resource/formats.rb
activeresource-3.0.5 lib/active_resource/formats.rb
activeresource-3.0.5.rc1 lib/active_resource/formats.rb
activeresource-3.0.4 lib/active_resource/formats.rb
activeresource-3.0.4.rc1 lib/active_resource/formats.rb
activeresource-3.0.4.rc lib/active_resource/formats.rb
activeresource-3.0.3 lib/active_resource/formats.rb
activeresource-3.0.2 lib/active_resource/formats.rb
activeresource-3.0.1 lib/active_resource/formats.rb
activeresource-3.0.0 lib/active_resource/formats.rb
activeresource-3.0.0.rc2 lib/active_resource/formats.rb