Sha256: 28c88fd6b98cf3baab966fdbf6f054f4b234932612343430185bd89d7ec615fa
Contents?: true
Size: 523 Bytes
Versions: 8
Compression:
Stored size: 523 Bytes
Contents
module Alf module Types # # Attribute name. # # Attribute names are ruby symbols that match the following regular expression: # # /^[a-zA-Z0-9_]+[?!]?$/ # # Example: # # AttrName.coerce("city") # # => :city # class AttrName < Symbol extend Domain::SByC.new(Symbol){|s| s.to_s =~ /^[a-zA-Z0-9_]+[?!]?$/} coercions do |c| c.delegate(:to_sym){|v,_| new(v.to_sym) } end end # class AttrName end # module Types end # module Alf
Version data entries
8 entries across 8 versions & 1 rubygems