module Platformx # # Faker helpers # # @author Tim Mushen # module FakerHelpers # Faker Email # @return [String] fake email def x_faker_email() return Faker::Internet.safe_email end # Faker First Name # @return [String] fake first name def x_faker_first_name() return Faker::Name.first_name end # Faker Last Name # @return [String] fake last name def x_faker_last_name() return Faker::Name.last_name end # Faker Street Address # @return [String] fake street address def x_faker_street_address() return Faker::Address.street_address end # Faker City # @return [String] fake city def x_faker_city() return Faker::Address.city end # Faker State # @return [String] fake state def x_faker_state() return Faker::Address.state_abbr end # Faker Zip # @return [String] fake zip def x_faker_zip() return Faker::Address.zip end # Faker Phone # @return [String] fake phone def x_faker_phone() return Faker::PhoneNumber.phone_number end # Faker Password # @return [String] fake password def x_faker_password() return Faker::Internet.password end # Faker UUID # @return [String] fake uuid def x_faker_uuid() return UUIDTools::UUID.random_create end # Faker Birthday # @return [String] fake birthday def x_faker_birthday() return Faker::Time.between(15.years.ago, 5.years.ago) end # Faker Number # @param length [Integer] length of the number # @return [String] fake number def x_faker_number(length: 2) return Faker::Number.number(length) end # Faker Boolean # @return [Boolean] fake boolean def x_faker_boolean() return Faker::Boolean.boolean(0.2) end # Faker Range # @param low [Integer] the minimum of the range # @param high [Integer] the highest value of the range # @return [Integer] fake integer between given values def x_faker_range(low:1, high:10) return Faker::Number.between(low, high) end # Faker Price # @return [String] fake price # @example # x_faker_price # -> 45.5 def x_faker_price() return Faker::Commerce.price end # Faker Chars # @param length [Integer] length of the char string # @return [String] fake char string def x_faker_characters(length: 10) return Faker::Lorem.characters(length) end # Faker Full Name # @return [String] fake full name def x_faker_full_name() return Faker::Name.name end end end