D7net
Home
Console
Upload
information
Create File
Create Folder
About
Tools
:
/
proc
/
self
/
root
/
opt
/
alt
/
ruby34
/
share
/
ri
/
system
/
Data
/
Filename :
hash-i.ri
back
Copy
U:RDoc::AnyMethod[iI" hash:ETI"Data#hash;TF:publico:RDoc::Markup::Document:@parts[o:RDoc::Markup::Paragraph; [I"NRedefines Object#hash (used to distinguish objects as Hash keys) so that ;TI"Qdata objects of the same class with same content would have the same +hash+ ;TI".value, and represented the same Hash key.;To:RDoc::Markup::BlankLine o:RDoc::Markup::Verbatim; [I"+Measure = Data.define(:amount, :unit) ;TI" ;TI"=Measure[1, 'km'].hash == Measure[1, 'km'].hash #=> true ;TI"?Measure[1, 'km'].hash == Measure[10, 'km'].hash #=> false ;TI"=Measure[1, 'km'].hash == Measure[1, 'm'].hash #=> false ;TI"@Measure[1, 'km'].hash == Measure[1.0, 'km'].hash #=> false ;TI" ;TI"D# Structurally similar data class, but shouldn't be considered ;TI"# the same hash key ;TI"/Measurement = Data.define(:amount, :unit) ;TI" ;TI"AMeasure[1, 'km'].hash == Measurement[1, 'km'].hash #=> false;T:@format0: @fileI" struct.c;T:0@omit_headings_from_table_of_contents_below0I"hash -> integer ;T0[ I"();T@FI" Data;TcRDoc::NormalClass00