Sha256: a947eb263bcedd9e1a41d6ef91d7925009d1727638c2a1c6b1f9b82ee34ef283
Contents?: true
Size: 586 Bytes
Versions: 10
Compression:
Stored size: 586 Bytes
Contents
module Finitio module HeadingBasedType def initialize(heading, name = nil, metadata = nil) unless heading.is_a?(Heading) raise ArgumentError, "Heading expected, got `#{heading}`" end super(name, metadata) @heading = heading end attr_reader :heading def [](attrname) heading.fetch(attrname) end def ==(other) super || (other.is_a?(self.class) && heading == other.heading) end alias :eql? :== def hash self.class.hash ^ heading.hash end end # module HeadingBasedType end # module Finitio
Version data entries
10 entries across 10 versions & 1 rubygems