Sha256: 470cf2639033539696a77af41c5c1da82459e820bf4bf2415f8921c4cb21f776
Contents?: true
Size: 250 Bytes
Versions: 2
Compression:
Stored size: 250 Bytes
Contents
# frozen_string_literal: true module ValidatesHost class HostName def initialize(host_name) @host_name = host_name end def valid? return true if @host_name.blank? @host_name =~ /^[a-z][a-z0-9-]+$/ end end end
Version data entries
2 entries across 2 versions & 1 rubygems
Version | Path |
---|---|
validates_host-1.3.0 | lib/validates_host/host_name.rb |
validates_host-1.2.0 | lib/validates_host/host_name.rb |