Sha256: 1a92889ec5e9f95a6fe9665bbf69bf6c06364c647d8f8c6d2a5e18f30b6606bf

Contents?: true

Size: 636 Bytes

Versions: 2

Compression:

Stored size: 636 Bytes

Contents

# frozen_string_literal: true

module Cmdlet
  # Tokenize and apply case and/or separator
  module Case
    # Sentence: Sentence case the characters in the given 'string'
    class Sentence < Cmdlet::BaseCmdlet
      #
      # @param [String|Int] value - value - to be converted
      # @return [String] value converted to sentence case
      def call(value)
        tokenizer.parse(value,
                        separator: ' ',
                        preserve_case: true,
                        compress_prefix_numerals: false,
                        compress_suffix_numerals: false).titleize
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cmdlet-0.3.0 lib/cmdlet/case/sentence.rb
cmdlet-0.2.1 lib/cmdlet/case/sentence.rb