Object
# File lib/randexp/randgen.rb, line 29 29: def self.alpha_numeric(options = {}) 30: [char, digit].pick 31: end
# File lib/randexp/randgen.rb, line 5 5: def self.bool(options = {}) 6: ['true', 'false'].pick 7: end
# File lib/randexp/randgen.rb, line 17 17: def self.char(options = {}) 18: [lchar, uchar].pick 19: end
# File lib/randexp/randgen.rb, line 25 25: def self.digit(options = {}) 26: ('0'..'9').to_a.pick 27: end
# File lib/randexp/randgen.rb, line 58 58: def self.email(options = {}) 59: domain = options.fetch(:domain, "#{word(options)}.example.org") 60: "#{word(options)}@#{domain}" 61: end
# File lib/randexp/randgen.rb, line 42 42: def self.first_name(options = {}) 43: RealName.first_names(options).pick 44: end
# File lib/randexp/randgen.rb, line 9 9: def self.lchar(options = {}) 10: ('a'..'z').to_a.pick 11: end
# File lib/randexp/randgen.rb, line 54 54: def self.name(options = {}) 55: "#{first_name(options)} #{surname(options)}" 56: end
# File lib/randexp/randgen.rb, line 67 67: def self.paragraph(options = {}) 68: ((options[:length] || SENTENCES_PER_PARAGRAPH.pick).of { sentence } * ". ") + "." 69: end
# File lib/randexp/randgen.rb, line 71 71: def self.phone_number(options = {}) 72: case options[:length] 73: when 7 then /\d{3}-\d{4}/.gen 74: when 10 then /\d{3}-\d{3}-\d{4}/.gen 75: else /(\d{3}-)?\d{3}-\d{4}/.gen 76: end 77: end
# File lib/randexp/randgen.rb, line 63 63: def self.sentence(options = {}) 64: ((options[:length] || WORDS_PER_SENTENCE.pick).of { word } * " ").capitalize 65: end
# File lib/randexp/randgen.rb, line 46 46: def self.surname(options = {}) 47: RealName.surnames(options).pick 48: end
# File lib/randexp/randgen.rb, line 13 13: def self.uchar(options = {}) 14: ('A'..'Z').to_a.pick 15: end
Disabled; run with --debug to generate this.
Generated with the Darkfish Rdoc Generator 1.1.6.