Skip to content

Latest commit

 

History

History
executable file
·
82 lines (52 loc) · 2.75 KB

internet.md

File metadata and controls

executable file
·
82 lines (52 loc) · 2.75 KB

Faker::Internet

# Optional arguments name=nil, *separators
Faker::Internet.email #=> "[email protected]"

Faker::Internet.email('Nancy') #=> "[email protected]"

Faker::Internet.email('Janelle Santiago', '+') #=> [email protected]"

# Optional argument name=nil
Faker::Internet.free_email #=> "[email protected]"

Faker::Internet.free_email('Nancy') #=> "[email protected]"

# Optional argument name=nil
Faker::Internet.safe_email #=> "[email protected]"

Faker::Internet.safe_email('Nancy') #=> "[email protected]"

# Optional arguments specifier=nil, separators=%w(. _)
Faker::Internet.username #=> "alexie"

Faker::Internet.username('Nancy') #=> "nancy"

Faker::Internet.username('Nancy Johnson', %w(. _ -)) #=> "johnson-nancy"

# Optional arguments: min_length=5, max_length=8
Faker::Internet.username(5..8)

# Optional argument min_length=8
Faker::Internet.username(8)

# Optional arguments: min_length=8, max_length=16
Faker::Internet.password #=> "Vg5mSvY1UeRg7"

Faker::Internet.password(8) #=> "YfGjIk0hGzDqS0"

Faker::Internet.password(10, 20) #=> "EoC9ShWd1hWq4vBgFw"

Faker::Internet.password(10, 20, true) #=> "3k5qS15aNmG"

Faker::Internet.password(10, 20, true, true) #=> "*%NkOnJsH4"

Faker::Internet.domain_name #=> "effertz.info"

Faker::Internet.domain_word #=> "haleyziemann"

Faker::Internet.domain_suffix #=> "info"

Faker::Internet.ip_v4_address #=> "24.29.18.175"

# Private IP range according to RFC 1918 and 127.0.0.0/8 and 169.254.0.0/16.
Faker::Internet.private_ip_v4_address #=> "10.0.0.1"

# Guaranteed not to be in the ip range from the private_ip_v4_address method.
Faker::Internet.public_ip_v4_address #=> "24.29.18.175"

Faker::Internet.ip_v4_cidr #=> "24.29.18.175/21"

Faker::Internet.ip_v6_address #=> "ac5f:d696:3807:1d72:2eb5:4e81:7d2b:e1df"

Faker::Internet.ip_v6_cidr #=> "ac5f:d696:3807:1d72:2eb5:4e81:7d2b:e1df/78"

# Optional argument prefix=''
Faker::Internet.mac_address #=> "e6:0d:00:11:ed:4f"
Faker::Internet.mac_address('55:44:33') #=> "55:44:33:02:1d:9b"

# Optional arguments: host=domain_name, path="/#{username}", scheme=scheme
Faker::Internet.url #=> "http://thiel.com/chauncey_simonis"
Faker::Internet.url('example.com') #=> "http://example.com/clotilde.swift"
Faker::Internet.url('example.com', '/foobar.html') #=> "http://example.com/foobar.html"

# Optional arguments: words=nil, glue=nil
Faker::Internet.slug #=> "pariatur_laudantium"
Faker::Internet.slug('foo bar') #=> "foo.bar"
Faker::Internet.slug('foo bar', '-') #=> "foo-bar"

# Optional argument: vendor=nil
Faker::Internet.user_agent #=> "Mozilla/5.0 (compatible; MSIE 9.0; AOL 9.7; AOLBuild 4343.19; Windows NT 6.1; WOW64; Trident/5.0; FunWebProducts)"
Faker::Internet.user_agent(:firefox) #=> "Mozilla/5.0 (Windows NT x.y; Win64; x64; rv:10.0) Gecko/20100101 Firefox/10.0"