BasicObject
Delegates ! to the _getobj_
# File delegate.rb, line 176 def ! !__getobj__ end
Returns true if two objects are not considered of equal value.
# File delegate.rb, line 160 def !=(obj) return false if obj.equal?(self) __getobj__ != obj end
Returns true if two objects are considered of equal value.
# File delegate.rb, line 152 def ==(obj) return true if obj.equal?(self) self.__getobj__ == obj end
This method must be overridden by subclasses and should return the object method calls are being delegated to.
# File delegate.rb, line 184 def __getobj__ __raise__ ::NotImplementedError, "need to define `__getobj__'" end
This method must be overridden by subclasses and change the object delegate to obj.
# File delegate.rb, line 192 def __setobj__(obj) __raise__ ::NotImplementedError, "need to define `__setobj__'" end
Returns true if two objects are considered of equal value.
# File delegate.rb, line 168 def eql?(obj) return true if obj.equal?(self) obj.eql?(__getobj__) end
:method: freeze Freeze both the object returned by _getobj_ and self.
# File delegate.rb, line 233 def freeze __getobj__.freeze super() end
Serialization support for the object returned by _getobj_.
# File delegate.rb, line 199 def marshal_dump ivars = instance_variables.reject {|var| /\A@delegate_/ =~ var} [ :__v2__, ivars, ivars.map {|var| instance_variable_get(var)}, __getobj__ ] end
Reinitializes delegation from a serialized object.
# File delegate.rb, line 211 def marshal_load(data) version, vars, values, obj = data if version == :__v2__ vars.each_with_index {|var, i| instance_variable_set(var, values[i])} __setobj__(obj) else __setobj__(data) end end
Returns the methods available to this delegate object as the union of this object’s and _getobj_ methods.
# File delegate.rb, line 127 def methods(all=true) __getobj__.methods(all) | super end