Sha256: 6c733362063471cf06e82fb235288ee907a93e2eb2d893f654edf74fdfc9c051
Contents?: true
Size: 497 Bytes
Versions: 12
Compression:
Stored size: 497 Bytes
Contents
module USaidWat class Either attr_reader :value def initialize(value) @value = value end def >>(&block) raise NoMethodError, 'subclasses must define >>' end def left? false end def right? false end end class Left < Either def >>(callable) self end def left? true end end class Right < Either def >>(callable) callable.call(self) end def right? true end end end
Version data entries
12 entries across 12 versions & 1 rubygems