Remove reference to singleton_class, that's Ruby 1.9 only.

This commit is contained in:
Michael Bleigh 2011-08-02 17:23:13 -05:00
parent 3bd79790bc
commit 5513b967b2
3 changed files with 4 additions and 4 deletions

View File

@ -1,5 +1,5 @@
guard 'rspec' do
watch(%r{^spec/.+_spec\.rb})
watch(%r{^lib/(.+)\.rb}) { |m| "spec/lib/#{m[1]}_spec.rb" }
watch(%r{^lib/(.+)\.rb}) { |m| "spec/#{m[1]}_spec.rb" }
watch('spec/spec_helper.rb') { "spec" }
end

View File

@ -38,7 +38,7 @@ module Hashie
# a hash without modifying the actual class. This is what
# allows IndifferentAccess to spread to sub-hashes.
def self.inject!(hash)
hash.singleton_class.send :include, Hashie::Extensions::IndifferentAccess
(class << hash; self; end).send :include, Hashie::Extensions::IndifferentAccess
hash.convert!
end
@ -103,7 +103,7 @@ module Hashie
def hash_with_indifference?(other)
other.is_a?(::Hash) &&
other.respond_to?(:indifferent_access?) &&
other.indifference_access?
other.indifferent_access?
end
end
end

View File

@ -16,7 +16,7 @@ module Hashie
#
module MergeInitializer
def initialize(hash = {}, default = nil, &block)
super(default, &block)
default ? super(default) : super(&block)
update(hash)
end
end