Method: Faker::HTML.random
- Defined in:
- lib/faker/default/html.rb
.random(methods) ⇒ String
Produces a random method from the methods above, excluding the methods listed in the arguments.
187 188 189 190 191 |
# File 'lib/faker/default/html.rb', line 187 def random(exclude: []) method_list = available_methods exclude.each { |ex| method_list.delete_if { |meth| meth == ex.to_sym } } send(method_list[Faker::Config.random.rand(0..(method_list.length - 1))]) end |