Method: Faker::Types.random_complex_type

Defined in:
lib/faker/default/types.rb

.random_complex_typeObject



57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/faker/default/types.rb', line 57

def random_complex_type
  types = SIMPLE_TYPES + COMPLEX_TYPES
  type_to_use = types[rand(0..types.length - 1)]
  case type_to_use
  when :string
    rb_string
  when :fixnum
    rb_integer
  when :hash
    rb_hash
  when :array
    rb_array
  end
end