class NoSE::Fields::StringField

Field holding a string of some average length

Constants

TYPE

Strings are stored as strings

Public Class Methods

new(name, length = 10, **options) click to toggle source
Calls superclass method NoSE::Fields::Field::new
# File lib/nose/model/fields.rb, line 204
def initialize(name, length = 10, **options)
  super(name, length, **options)
end
value_from_string(string) click to toggle source

Return the String parameter as-is @return [String]

# File lib/nose/model/fields.rb, line 210
def self.value_from_string(string)
  string
end

Public Instance Methods

random_value() click to toggle source

A random string of the correct length @return [String]

# File lib/nose/model/fields.rb, line 216
def random_value
  Faker::Lorem.characters(number: @size)
end