class Faker::Number
def binary(digits: 4)
-
(String)
-
Parameters:
-
digits
(Integer
) -- Number of digits to generate the binary as string
def binary(digits: 4) bin = '' digits.times { bin += rand(2).to_s(2) } bin end
(String)
-
digits
(Integer
)
-- Number of digits to generate the binary as string
def binary(digits: 4) bin = '' digits.times { bin += rand(2).to_s(2) } bin end