Sha256: fc915c00e0be406da06dac4ab22c23a0b90a1edddf9a16575c251c229da5bdb8
Contents?: true
Size: 406 Bytes
Versions: 5
Compression:
Stored size: 406 Bytes
Contents
# frozen_string_literal: true module SimpleValidate module Utils def self.camelize(input) = input.to_s.split("_").map(&:capitalize).join def self.extract_options!(args) = args.last.is_a?(Hash) ? args.pop : {} def self.classify(input) = Object.const_get(camelize(input)) def self.article(input) vowels = %w[a e i o u] vowels.include?(input[0]) ? "an" : "a" end end end
Version data entries
5 entries across 5 versions & 1 rubygems