Method: Paraxial.trim_dep

Defined in:
lib/paraxial.rb

.trim_dep(input) ⇒ Object



147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
# File 'lib/paraxial.rb', line 147

def self.trim_dep(input)
  if input.nil?
    nil
  else
    cleaned_string = input.gsub(/\n/, '')

    # Find the position of the first period
    period_index = cleaned_string.index('.')

    # If there's a period, truncate the string up to that point
    cleaned_string = cleaned_string[0..period_index] if period_index

    cleaned_string
  end
end