Sha256: d53350e9e9bebb8b74ef0b75e3296e406a37c31417964614e1f91a7e95b63153
Contents?: true
Size: 409 Bytes
Versions: 16
Compression:
Stored size: 409 Bytes
Contents
# frozen_string_literal: true module ImmutableStructEx # Makes a struct comparable with another struct or hash when extended. module Comparable class << self def extended(struct) struct.instance_eval do def ==(other) return false unless other.is_a?(Hash) || other.is_a?(Struct) to_h == other.to_h end end end end end end
Version data entries
16 entries across 16 versions & 1 rubygems