BasicObject
Delegates ! to the _getobj_
# File delegate.rb, line 169 def ! !__getobj__ end
Returns true if two objects are not considered of equal value.
# File delegate.rb, line 153 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 145 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 177 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 185 def __setobj__(obj) __raise__ ::NotImplementedError, "need to define `__setobj__'" end
Returns true if two objects are considered of equal value.
# File delegate.rb, line 161 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 226 def freeze __getobj__.freeze super() end
Serialization support for the object returned by _getobj_.
# File delegate.rb, line 192 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 204 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 120 def methods(all=true) __getobj__.methods(all) | super end