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

Version Path
activeresource-2.3.18 lib/active_resource/formats.rb
activeresource_csi-2.3.5.p8 lib/active_resource/formats.rb
activeresource-2.3.17 lib/active_resource/formats.rb
activeresource_csi-2.3.5.p7 lib/active_resource/formats.rb
activeresource_csi-2.3.5.20130130071128 lib/active_resource/formats.rb
activeresource_csi-2.3.5.p6 lib/active_resource/formats.rb
activeresource-2.3.16 lib/active_resource/formats.rb
activeresource-2.3.15 lib/active_resource/formats.rb
radiant-1.0.0 ruby-debug/ruby/1.8/gems/activeresource-2.3.14/lib/active_resource/formats.rb
vanity-1.7.1 vendor/ruby/1.9.1/gems/activeresource-2.3.12/lib/active_resource/formats.rb
activeresource-2.3.14 lib/active_resource/formats.rb
kajam-1.0.3.rc2 vendor/rails/activeresource/lib/active_resource/formats.rb
activeresource-2.3.12 lib/active_resource/formats.rb
radiant-1.0.0.rc2 vendor/rails/activeresource/lib/active_resource/formats.rb
radiant-1.0.0.rc1 vendor/rails/activeresource/lib/active_resource/formats.rb
webroar-0.5.0 src/admin_panel/vendor/rails/activeresource/lib/active_resource/formats.rb
activeresource-2.3.11 lib/active_resource/formats.rb
radiantcms-couchrest_model-0.2.4 vendor/rails/activeresource/lib/active_resource/formats.rb
radiantcms-couchrest_model-0.2.2 vendor/rails/activeresource/lib/active_resource/formats.rb
radiantcms-couchrest_model-0.2.1 vendor/rails/activeresource/lib/active_resource/formats.rb