class DirtySeed::Assigners::Type::String

Manages string assignments

Public Instance Methods

value() click to toggle source

Returns a random string matching validators @return [String] @note `regex_value` is generated in RegexHelper

# File lib/dirty_seed/assigners/type/string.rb, line 15
def value
  regex ? regex_value : default
end

Private Instance Methods

default() click to toggle source

Returns a standard string @return [String] @note `min` and `max` are defined in MinMaxHelper

# File lib/dirty_seed/assigners/type/string.rb, line 24
def default
  faker_value(
    generator: :Lorem,
    method: :paragraph_by_chars,
    options: { number: rand(min..max), supplemental: false }
  )
end