Sha256: 4e9ae3fcbe294621999d8392038c9d347958a4a267b554d439a6388520a18be9
Contents?: true
Size: 700 Bytes
Versions: 5
Compression:
Stored size: 700 Bytes
Contents
# frozen_string_literal: true require_relative 'mixins/multivaluable' require_relative '../value_equality' module Shivers module Parts class AlphanumericOrHyphen include ValueEquality include Mixins::Multivaluable def initialize(data = {}) @traits = data[:traits] || [] end def matcher /[a-zA-Z0-9-]+/ end def convert(value) value end def capturable? true end def ==(other) other.class == self.class && other.state == state end alias eql? == def hash self.class.hash ^ state.hash end def state [@traits] end end end end
Version data entries
5 entries across 5 versions & 1 rubygems