Method: MotionPrime::FormSection#allow_string_replacement?

Defined in:
motion-prime/sections/form.rb

#allow_string_replacement?(target, limit, range, string) ⇒ Boolean

Returns:

  • (Boolean)


143
144
145
146
147
148
149
# File 'motion-prime/sections/form.rb', line 143

def allow_string_replacement?(target, limit, range, string)
  if string.length.zero? || (range.length + limit - target.text.length) >= string.length
    true
  else
    target.text.length < limit
  end
end