Class: Case::Struct

Inherits:
Struct
  • Object
show all
Defined in:
lib/case.rb

Overview

Like regular Struct, except that Struct#=== performs a structural match

Instance Method Summary collapse

Instance Method Details

#===(other) ⇒ Object



12
13
14
15
16
# File 'lib/case.rb', line 12

def ===(other)
  return false unless self.class == other.class
  zip(other) { |a, b| return false unless a === b }
  true
end