Object
# File lib/randexp/randgen.rb, line 29 def self.alpha_numeric(options = {}) [char, digit].pick end
# File lib/randexp/randgen.rb, line 5 def self.bool(options = {}) ['true', 'false'].pick end
# File lib/randexp/randgen.rb, line 17 def self.char(options = {}) [lchar, uchar].pick end
# File lib/randexp/randgen.rb, line 25 def self.digit(options = {}) ('0'..'9').to_a.pick end
# File lib/randexp/randgen.rb, line 58 def self.email(options = {}) domain = options.fetch(:domain, "#{word(options)}.example.org") "#{word(options)}@#{domain}" end
# File lib/randexp/randgen.rb, line 42 def self.first_name(options = {}) RealName.first_names(options).pick end
# File lib/randexp/randgen.rb, line 9 def self.lchar(options = {}) ('a'..'z').to_a.pick end
# File lib/randexp/randgen.rb, line 54 def self.name(options = {}) "#{first_name(options)} #{surname(options)}" end
# File lib/randexp/randgen.rb, line 67 def self.paragraph(options = {}) ((options[:length] || SENTENCES_PER_PARAGRAPH.pick).of { sentence } * ". ") + "." end
# File lib/randexp/randgen.rb, line 71 def self.phone_number(options = {}) case options[:length] when 7 then /\d{3}-\d{4}/.gen when 10 then /\d{3}-\d{3}-\d{4}/.gen else /(\d{3}-)?\d{3}-\d{4}/.gen end end
# File lib/randexp/randgen.rb, line 63 def self.sentence(options = {}) ((options[:length] || WORDS_PER_SENTENCE.pick).of { word } * " ").capitalize end
# File lib/randexp/randgen.rb, line 46 def self.surname(options = {}) RealName.surnames(options).pick end
# File lib/randexp/randgen.rb, line 13 def self.uchar(options = {}) ('A'..'Z').to_a.pick end
Generated with the Darkfish Rdoc Generator 2.