[LRUG] Understanding Ruby Tempfile documentation

Graham Ashton graham at effectif.com
Tue Jan 26 04:19:44 PST 2016


On Tue, 26 Jan 2016, at 12:05 PM, Jonathon Horsman wrote:
> 
> Trying to understand Tempfile, so reading the docs:
> 
> http://docs.ruby-lang.org/en/2.2.0/Tempfile.html
> 
> I assume it's a subclass of IO, but I can't see any mention of this.
> 
> It does however say:
> 
> *Parent:*
> *DelegateClass(File)*
> 
> what does this mean?

It means `Tempfile` inherits from `DelegateClass(File)`. If you check the docs for `DelegateClass` you’ll see it uses `Tempfile as an example:

http://docs.ruby-lang.org/en/2.2.0/Object.html#method-i-DelegateClass

Cheers,
Graham



More information about the Chat mailing list