Sha256: 4b77a37918cd6fcea3c8afe37513e1d0691662a1f8772777d2c6c2d4c6a095b0

Contents?: true

Size: 518 Bytes

Versions: 23

Compression:

Stored size: 518 Bytes

Contents

module ActiveSupport
  module JSON #:nodoc:
    module Encoders
      mattr_accessor :encoders
      @@encoders = {}

      class << self        
        def define_encoder(klass, &block)
          encoders[klass] = block
        end
        
        def [](klass)
          klass.ancestors.each do |k|
            encoder = encoders[k]
            return encoder if encoder
          end
        end
      end
    end
  end
end

Dir[File.dirname(__FILE__) + '/encoders/*.rb'].each do |file|
  require file[0..-4]
end

Version data entries

23 entries across 23 versions & 5 rubygems

Version Path
jstorimer-deep-test-2.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/json/encoders.rb
jstorimer-deep-test-1.4.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/json/encoders.rb
jstorimer-deep-test-1.3.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/json/encoders.rb
jstorimer-deep-test-1.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/json/encoders.rb
jstorimer-deep-test-1.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/json/encoders.rb
jstorimer-deep-test-1.0.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/json/encoders.rb
jstorimer-deep-test-0.2.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/json/encoders.rb
jstorimer-deep-test-0.1.0 sample_rails_project/vendor/rails/activesupport/lib/active_support/json/encoders.rb
activesupport-1.4.3 lib/active_support/json/encoders.rb
activesupport-1.4.2 lib/active_support/json/encoders.rb
activesupport-1.3.0 lib/active_support/json/encoders.rb
activesupport-1.3.1 lib/active_support/json/encoders.rb
activesupport-1.4.0 lib/active_support/json/encoders.rb
activesupport-1.4.1 lib/active_support/json/encoders.rb
activesupport-1.4.4 lib/active_support/json/encoders.rb
monetra-ruby-0.0.6 lib/monetra/active_support/json/encoders.rb
radiant-0.6.1 vendor/rails/activesupport/lib/active_support/json/encoders.rb
radiant-0.6.0 vendor/rails/activesupport/lib/active_support/json/encoders.rb
radiant-0.6.3 vendor/rails/activesupport/lib/active_support/json/encoders.rb
radiant-0.6.2 vendor/rails/activesupport/lib/active_support/json/encoders.rb