Sha256: 5727ccc41b34deb0b82505967cc4359fac7ec35fe8d61af5dfae9092290243dc

Contents?: true

Size: 793 Bytes

Versions: 25

Compression:

Stored size: 793 Bytes

Contents

# A base class with no predefined methods that tries to behave like Builder's
# BlankSlate in Ruby 1.9. In Ruby pre-1.9, this is actually the
# Builder::BlankSlate class.
#
# Ruby 1.9 introduces BasicObject which differs slightly from Builder's
# BlankSlate that has been used so far. ActiveSupport::BasicObject provides a
# barebones base class that emulates Builder::BlankSlate while still relying on
# Ruby 1.9's BasicObject in Ruby 1.9.
module ActiveSupport
  if RUBY_VERSION >= '1.9'
    class BasicObject < ::BasicObject
      undef_method :==
      undef_method :equal?

      # Let ActiveSupport::BasicObject at least raise exceptions.
      def raise(*args)
        ::Object.send(:raise, *args)
      end
    end
  else
    require 'blankslate'
    BasicObject = BlankSlate
  end
end

Version data entries

25 entries across 25 versions & 7 rubygems

Version Path
activesupport-2.1.0 lib/active_support/basic_object.rb
antfarm-0.3.0 rails/vendor/rails/activesupport/lib/active_support/basic_object.rb
antfarm-0.4.0 rails/vendor/rails/activesupport/lib/active_support/basic_object.rb
radiant-0.7.0 vendor/rails/activesupport/lib/active_support/basic_object.rb
radiant-0.7.1 vendor/rails/activesupport/lib/active_support/basic_object.rb