Module: Practical::Helpers::TextHelper

Defined in:
lib/practical/helpers/text_helper.rb

Instance Method Summary collapse

Instance Method Details

#double_quoted_text(text) ⇒ Object



4
5
6
# File 'lib/practical/helpers/text_helper.rb', line 4

def double_quoted_text(text)
  "#{text}"
end

#initials(name:) ⇒ Object



12
13
14
15
16
17
18
19
# File 'lib/practical/helpers/text_helper.rb', line 12

def initials(name:)
  space_split = name.split(" ")
  if space_split.size >= 2
    return space_split.first(2).map{|x| x[0]&.upcase }.join("")
  end

  return name.first(2).upcase
end

#single_quoted_text(text) ⇒ Object



8
9
10
# File 'lib/practical/helpers/text_helper.rb', line 8

def single_quoted_text(text)
  "#{text}"
end