Skip to content

Documentation


Documentation / @blazetrails/activesupport / rbHash

Function: rbHash() ​

rbHash(value): number

Defined in: packages/ruby-compat/dist/rb-hash.d.ts:17

Ruby's Object#hash (vendor/ruby/v3.3.11/object.c:4375, rb_define_method(rb_mKernel, "hash", rb_obj_hash, 0)), with the Array#hash (vendor/ruby/v3.3.11/array.c:5205 rb_ary_hash) and String#hash (vendor/ruby/v3.3.11/string.c:3629 rb_str_hash) arms the ports send — the value every eql?-pairing hash body composes with. Ported node bodies spell [self.class, @left, @right].hash, and JS has no hash on Object, Array, String or Class at all, so one copy serves every ported hash.

Like Ruby, it is consistent with rbEqual: two objects that are == hash alike, and an object whose class defines no hash falls back to identity.

Parameters ​

ParameterType
valueunknown

Returns ​

number

No Rails Equivalent ​

PERMANENT — Object#hash / Array#hash / String#hash are C primitives (vendor/ruby/v3.3.11/object.c:4375, array.c:5205, string.c:3629), not Ruby methods, so they have no counterpart file.