1
0
mirror of https://github.com/askn/faker.git synced 2023-08-10 21:13:01 +03:00

add slug and url

This commit is contained in:
Aşkın Gedik
2016-01-06 16:01:56 +02:00
parent ae08268c78
commit 0872d98f55
3 changed files with 15 additions and 0 deletions

View File

@@ -44,5 +44,14 @@ module Faker
(2..254).to_a.sample,
].join('.')
end
def self.url
"http://#{domain_name}/#{user_name}"
end
def self.slug(words = nil, glue = nil)
glue ||= %w(- _ .).sample
(words || Lorem.words(2).join(' ')).gsub(' ', glue).downcase
end
end
end