Module: Faker
- Defined in:
- lib/gems/faker-0.3.1/lib/faker/version.rb,
lib/gems/faker-0.3.1/lib/faker.rb,
lib/gems/faker-0.3.1/lib/faker/name.rb,
lib/gems/faker-0.3.1/lib/faker/lorem.rb,
lib/gems/faker-0.3.1/lib/faker/address.rb,
lib/gems/faker-0.3.1/lib/faker/company.rb,
lib/gems/faker-0.3.1/lib/faker/internet.rb,
lib/gems/faker-0.3.1/lib/faker/phone_number.rb
Overview
Defined Under Namespace
Modules: VERSION
Classes: Address, Company, Internet, Lorem, Name, PhoneNumber
Class Method Summary
collapse
Class Method Details
.bothify(string) ⇒ Object
23
24
25
|
# File 'lib/gems/faker-0.3.1/lib/faker.rb', line 23
def self.bothify(string)
self.letterify(self.numerify(string))
end
|
.letterify(letter_string) ⇒ Object
19
20
21
|
# File 'lib/gems/faker-0.3.1/lib/faker.rb', line 19
def self.letterify(letter_string)
letter_string.gsub(/\?/) { ('a'..'z').to_a.rand }
end
|
.numerify(number_string) ⇒ Object
15
16
17
|
# File 'lib/gems/faker-0.3.1/lib/faker.rb', line 15
def self.numerify(number_string)
number_string.gsub(/#/) { rand(10).to_s }
end
|