module HasPlaceholderImage::TextGenerator

Text generation methods

Public Class Methods

two_word_first_letter_upcase(value) click to toggle source

This method take text field and parse with delimiter and take first word_count number word first letter upcase

# File lib/has_placeholder_image/text_generator.rb, line 8
def self.two_word_first_letter_upcase(value)
  value.split
       .map(&:first)
       .select { |l| l =~ /[[:alpha:]]/ }
       .join
       .first(2)
       .upcase
end