Method: Faker::Types.random_type
- Defined in:
- lib/faker/default/types.rb
.random_type ⇒ String, Integer
Produces a random type that’s either a String or an Integer.
118 119 120 121 122 123 124 125 126 |
# File 'lib/faker/default/types.rb', line 118 def random_type type_to_use = SIMPLE_TYPES[rand(0..SIMPLE_TYPES.length - 1)] case type_to_use when :string rb_string when :fixnum rb_integer end end |