Sha256: 1af409d0949d26b8bea13214739818f5264987c7c51a4d20e94c320d719d6fe7

Contents?: true

Size: 1.09 KB

Versions: 3

Compression:

Stored size: 1.09 KB

Contents

module RandomData

  # Methods to create realistic-looking names
  module Names
    
    # Returns a random letter
    
    def initial
      ('A'..'Z').to_a.rand
    end


    @@lastnames = %w( SMITH JOHNSON WILLIAMS JONES BROWN DAVIS MILLER WILSON MOORE TAYLOR ANDERSON THOMAS JACKSON WHITE HARRIS MARTIN THOMPSON GARCIA MARTINEZ 
                      ROBINSON CLARK RODRIGUEZ LEWIS LEE WALKER )

    # Returns a random lastname
    #
    # >> Random.lastname
    #
    # "Harris"

    def lastname
      @@lastnames.rand.capitalize
    end

    @@firstnames = %w(JAMES JOHN ROBERT MICHAEL WILLIAM DAVID RICHARD CHARLES JOSEPH THOMAS CHRISTOPHER DANIEL PAUL MARK DONALD GEORGE KENNETH STEVEN EDWARD BRIAN 
                      RONALD ANTHONY KEVIN JASON MARY PATRICIA LINDA BARBARA ELIZABETH JENNIFER MARIA SUSAN MARGARET DOROTHY LISA NANCY KAREN BETTY HELEN SANDRA 
                      DONNA CAROL RUTH SHARON MICHELLE LAURA SARAH KIMBERLY DEBORAH)

    # Returns a random firstname
    #
    # >> Random.firstname
    # 
    # "Sandra"

    def firstname
      @@firstnames.rand.capitalize
    end

  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
random_data-1.2.0 lib/random_data/names.rb
random_data-1.2.1 lib/random_data/names.rb
random_data-1.3.0 lib/random_data/names.rb