class Fab

Constants

AGENT_LIST
AZ
CHARS
LANGUAGE_CODE_ISO6391_LIST
NAME_CHARS
NOTE_CHARS

Public Instance Methods

agent() click to toggle source
# File lib/sixarm_ruby_fab/agent.rb, line 11
def agent
  agent_list.sample
end
agent_list() click to toggle source
# File lib/sixarm_ruby_fab/agent.rb, line 15
def agent_list
  @agent_list ||= AGENT_LIST
end
agent_list=(x) click to toggle source
# File lib/sixarm_ruby_fab/agent.rb, line 19
def agent_list=x
  @agent_list=x
end
basename(options = {}) click to toggle source

Fab a base name e.g. “myfile.txt”

The base name has two parts:

* The "intension" e.g. "myfile"
* The "extension" e.g. "txt"

Options:

* chars: a..z
* intension_length: [sent to #basename_intension as :length]
* extension_length: [sent to #basename_extension as :length]

@returns [String] a base name

# File lib/sixarm_ruby_fab/files.rb, line 29
def basename(options = {})
  intension = basename_intension(options[:intension_length] ? options.merge(length: intension_length) : options)
  extension = basename_extension(options[:extension_length] ? options.merge(length: extension_length) : options)
  "#{intension}.#{extension}"
end
basename_extension(options = {}) click to toggle source

Fab a file base name extension e.g. “txt”

Options:

* chars: a..z
* length: rand(1..5)

@returns [String] a base name extension

# File lib/sixarm_ruby_fab/files.rb, line 57
def basename_extension(options = {})
  (options[:chars] || AZ).sample(options[:size] || rand(1..5)).join
end
basename_intension(options = {}) click to toggle source

Fab a file base name intension e.g. “myfile”

Options:

* chars: a..z
* length: rand(1..30)

@returns [String] a base name intension

# File lib/sixarm_ruby_fab/files.rb, line 44
def basename_intension(options = {})
  (options[:chars] || AZ).sample(options[:size] || rand(1..30)).join
end
boolean() click to toggle source

Fab a boolean, either true or false.

@return [boolean] either true or false.

# File lib/sixarm_ruby_fab/basic.rb, line 8
def boolean
  [true, false].sample
end
city() click to toggle source

Fab a random city string. Delegates to Forgery::Address.city

@returns [String] a random city

# File lib/sixarm_ruby_fab/postal.rb, line 18
def city
  Forgery::Address.city 
end
company_name(options = {}) click to toggle source

Fab a company name. Delegates to Forgery::Name.company_name.

@returns [String] a random company name

# File lib/sixarm_ruby_fab/company.rb, line 9
def company_name(options = {})
  Forgery::Name.company_name
end
content_type(options = {}) click to toggle source

Fab a random content type part e.g. “image/jpeg”.

Options:

* chars: a..z
* size: rand(1..20) [per part]

@returns [String] a content type

# File lib/sixarm_ruby_fab/mime.rb, line 13
def content_type(options = {})
  "#{content_type_part(options)}/#{content_type_part(options)}"
end
content_type_part(options = {}) click to toggle source

Fab a random content type part e.g. “image”.

Options:

* chars: a..z
* size: rand(1..20)

@returns [String] a content type part

# File lib/sixarm_ruby_fab/mime.rb, line 26
def content_type_part(options = {})
  (options[:chars] || AZ).sample(options[:size] || rand(1..20)).join
end
date(options = {}) click to toggle source

Fab a random date.

Options:

* min: today - 1000 
* max: today + 1000

@returns [Date] a random date min..max

# File lib/sixarm_ruby_fab/date.rb, line 13
def date(options = {})
  rand((options[:min] || date_min)..(options[:max] || date_max))
end
date_max() click to toggle source

Get. The default is today + 1000.

# File lib/sixarm_ruby_fab/date.rb, line 28
def date_max
  @date_max ||= Date.today + 1000
end
date_max=(x) click to toggle source

Set.

# File lib/sixarm_ruby_fab/date.rb, line 33
def date_max=x
  @date_max=x
end
date_min() click to toggle source

Get. The default is today - 1000.

# File lib/sixarm_ruby_fab/date.rb, line 18
def date_min
  @date_min ||= Date.today - 1000
end
date_min=(x) click to toggle source

Set.

# File lib/sixarm_ruby_fab/date.rb, line 23
def date_min=x
  @date_min=x
end
datetime(options = {}) click to toggle source

Fab a random datetime.

Options:

* min: now - 1000 
* max: now + 1000

@returns [DateTime] a random datetime min..max

# File lib/sixarm_ruby_fab/datetime.rb, line 13
def datetime(options = {})
  rand((options[:min] || datetime_min)..(options[:max] || datetime_max))
end
datetime_max() click to toggle source

Get. The default is now + 1000.

# File lib/sixarm_ruby_fab/datetime.rb, line 28
def datetime_max
  @datetime_max ||= DateTime.now + 1000
end
datetime_max=(x) click to toggle source

Set.

# File lib/sixarm_ruby_fab/datetime.rb, line 33
def datetime_max=x
  @datetime_max=x
end
datetime_min() click to toggle source

Get. The default is now - 1000.

# File lib/sixarm_ruby_fab/datetime.rb, line 18
def datetime_min
  @datetime_min ||= DateTime.now - 1000
end
datetime_min=(x) click to toggle source

Set.

# File lib/sixarm_ruby_fab/datetime.rb, line 23
def datetime_min=x
  @datetime_min=x
end
description(options = {}) click to toggle source

Fab a random description.

Options:

* chars: NOTE_CHARS
* size: rand(20..200) [actual size may be less because we strip the string]

@returns [String] a random description

# File lib/sixarm_ruby_fab/text.rb, line 55
def description(options = {})
  (options[:chars] || NOTE_CHARS).sample(options[:size] || rand(20..200)).join.strip
end
dirname(options = {}) click to toggle source

Fab a directory name e.g. “/mydir1/mydir2”. This calls dirname_part rand times.

Options:

* parts: rand(2..6) [how many parts to use]
* chars: a..z [sent to #dirname_part]
* length: 1..20 per part [sent to #dirname_part]

@returns [String] a directory name

# File lib/sixarm_ruby_fab/files.rb, line 72
def dirname(options = {})
  pathname = Pathname.new("/")
  parts = options[:parts] || rand(2..6)
  parts.times.each{ pathname += dirname_part(options) }
  pathname.to_s
end
dirname_part(options = {}) click to toggle source

Fab a directory path part e.g. “mydir”.

Options:

* chars: a..z
* size: rand(1..20)

@returns [String] a directory name part

# File lib/sixarm_ruby_fab/files.rb, line 88
def dirname_part(options = {})
  (options[:chars] || AZ).sample(options[:size] || rand(1..20)).join
end
email_address() click to toggle source

Fab an email address. Delegate to Forgery::Email.address

@returns [String] an email address

# File lib/sixarm_ruby_fab/email.rb, line 9
def email_address
  Forgery::Email.address
end
family_name() click to toggle source

Fab a random last name. Delegates to Forgery::Name.last_name

@returns [String] a random last name

# File lib/sixarm_ruby_fab/names.rb, line 27
def family_name 
  Forgery::Name.last_name
end
file_extension(options = {}) click to toggle source

Fab a file extension. Delegates to basename_extension.

@returns [String] a file extension e.g. “txt”

TODO refactor this to streamline it

# File lib/sixarm_ruby_fab/files.rb, line 99
def file_extension(options = {})
  basename_extension(options)
end
file_path(options = {}) click to toggle source

Fab a file path. Delegates to path.

@returns [String] a file path e.g. “/mydir1/mydir2/myfile.txt”

TODO refactor this to streamline it

# File lib/sixarm_ruby_fab/files.rb, line 110
def file_path(options = {})
  path(options)
end
given_name() click to toggle source

Fab a random given name. Delegates to Forgery::Name.first_name

@returns [String] a random given name

# File lib/sixarm_ruby_fab/names.rb, line 9
def given_name 
  Forgery::Name.first_name
end
id(options = {}) click to toggle source

Fab a random id.

Options:

* min: 1
* max: 30000

@returns [Integer] a random id

# File lib/sixarm_ruby_fab/id.rb, line 13
def id(options = {})
  rand((options[:min] || 1)..(options[:max] || 30000))
end
ids(options = {}) click to toggle source

Fab a list of random ids.

Options:

* size: 3

@returns [Array] a list of random ids

# File lib/sixarm_ruby_fab/id.rb, line 25
def ids(options = {})
  (options[:size] || 3).times.map{ id(options) }
end
job_title(options = {}) click to toggle source

Fab a job title. Delegates to Forgery::Name.job_title.

@returns [String] a random company name

# File lib/sixarm_ruby_fab/company.rb, line 18
def job_title(options = {})
  Forgery::Name.job_title
end
language_code(options = {}) click to toggle source

Fab a language code e.g. “en” for English. Delegates to language_code_iso6391

@returns [String] a random language code

# File lib/sixarm_ruby_fab/locale.rb, line 16
def language_code(options = {})
  language_code_iso6391(options)
end
language_code_iso6391(options = {}) click to toggle source

Fab a language code e.g. “en” for English. Samples from LANGUAGE_CODE_ISO6391_LIST.

@returns [String] a random language code

# File lib/sixarm_ruby_fab/locale.rb, line 25
def language_code_iso6391(options = {})
  LANGUAGE_CODE_ISO6391_LIST.sample
end
language_code_iso6391_list() click to toggle source
# File lib/sixarm_ruby_fab/locale.rb, line 29
def language_code_iso6391_list
  @language_code_iso6391_list ||= LANGUAGE_CODE_ISO6391_LIST
end
language_code_iso6391_list=(x) click to toggle source
# File lib/sixarm_ruby_fab/locale.rb, line 33
def language_code_iso6391_list=x
  @language_code_iso6391_list=x
end
latitude() click to toggle source

Fab a random latitude.

@returns [Float] a random latitude in the range -90.0 to +90.0

# File lib/sixarm_ruby_fab/geo.rb, line 8
def latitude
  rand * 180.0 - 90.0
end
latitude_degrees() click to toggle source

Return a latitude's degrees component in the range -180 to +180 as an integer.

# File lib/sixarm_ruby_fab/geo.rb, line 13
def latitude_degrees
  rand(360)-180
end
latitude_direction() click to toggle source

Return a latitude's direction component, either “N” (north) or “S” (south)

# File lib/sixarm_ruby_fab/geo.rb, line 28
def latitude_direction
  ["N","S"].sample
end
latitude_minutes() click to toggle source

Return a latitude's minutes component in the range 0 to 60 as an integer.

# File lib/sixarm_ruby_fab/geo.rb, line 18
def latitude_minutes
  rand(60)
end
latitude_seconds() click to toggle source

Return a latitude's seconds component in the range 0 to 60 as an integer.

# File lib/sixarm_ruby_fab/geo.rb, line 23
def latitude_seconds
  rand(60)
end
longitude() click to toggle source

Fab a random longitude. Delegate to Forgery::Geo.longitude.

@returns [Float] a random longitude in the range -180.0 to +180.0

# File lib/sixarm_ruby_fab/geo.rb, line 37
def longitude
  rand * 360.0 - 180.0
end
longitude_degrees() click to toggle source

Return a longitude's degrees component in the range -180 to +180 as an integer.

# File lib/sixarm_ruby_fab/geo.rb, line 42
def longitude_degrees
  rand(360)-180
end
longitude_direction() click to toggle source

Return a longitude's direction component, either “E” (east) or “W” (west)

# File lib/sixarm_ruby_fab/geo.rb, line 57
def longitude_direction
  ["E","W"].sample
end
longitude_minutes() click to toggle source

Return a longitude's minutes component in the range 0 to 60 as an integer.

# File lib/sixarm_ruby_fab/geo.rb, line 47
def longitude_minutes
  rand(60)
end
longitude_seconds() click to toggle source

Return a longitude's seconds component in the range 0 to 60 as an integer.

# File lib/sixarm_ruby_fab/geo.rb, line 52
def longitude_seconds
  rand(60)
end
lorem(options = {}) click to toggle source

Fab a random lorem ipsum string.

Options:

* chars: NOTE_CHARS
* size: rand(20..200) [actual size may be less because we strip the string]

@returns [String] a random description

# File lib/sixarm_ruby_fab/text.rb, line 68
def lorem(options = {})
  (options[:chars] || NOTE_CHARS).sample(options[:size] || rand(20..200)).join.strip
end
middle_name() click to toggle source

Fab a random middle name. Delegates to Forgery::Name.first_name

@returns [String] a random middle name

# File lib/sixarm_ruby_fab/names.rb, line 18
def middle_name 
  Forgery::Name.first_name
end
name(options = {}) click to toggle source

Fab a random name.

Options:

* chars: NAME_CHARS
* size: rand(10..30) [actual size may be less because we strip the string]

@returns [String] a random name

# File lib/sixarm_ruby_fab/text.rb, line 16
def name(options = {})
  (options[:chars] || NAME_CHARS).sample(options[:size] || rand(10..30)).join.strip
end
note(options = {}) click to toggle source

Fab a random note.

Options:

* chars: NOTE_CHARS
* size: rand(1..200) [actual size may be less because we strip the string]

@returns [String] a random name

# File lib/sixarm_ruby_fab/text.rb, line 29
def note(options = {})
  (options[:chars] || NOTE_CHARS).sample(options[:size] || rand(1..200)).join.strip
end
password(options = {}) click to toggle source

Fab a random password.

Options:

* chars: a..z
* size: rand(9..40)

@returns [String] a random password

# File lib/sixarm_ruby_fab/password.rb, line 13
def password(options = {})
  (options[:chars] || AZ).sample(options[:size] || rand(9..40)).join
end
path(options = {}) click to toggle source

Fab a path e.g. “/mydir1/mydir2/myfile.txt”

@returns [String] a path

# File lib/sixarm_ruby_fab/files.rb, line 10
def path(options = {})
  (Pathname.new("") + dirname(options) + basename(options)).to_s
end
phone(options = {}) click to toggle source

Fab a random phone number string. Delegates to Forgery::Address.phone.

@returns [String] a random phone number string

# File lib/sixarm_ruby_fab/phone.rb, line 9
def phone(options = {})
  Forgery::Address.phone
end
rating(options = {}) click to toggle source

Fab a rating, such as 1 to 5 stars.

Options:

* min: 1
* max: 5

@return [Integer] a random number

# File lib/sixarm_ruby_fab/basic.rb, line 29
def rating(options = {})
  rand((options[:min] || 1)..(options[:max] || 5))
end
start_date(options = {}) click to toggle source

Fab a random start date. Delegates to date.

@returns [Date] a random date min..max

# File lib/sixarm_ruby_fab/date.rb, line 42
def start_date(options = {})
  date(options)
end
start_date_and_stop_date(options = {}) click to toggle source

Fab a random start date and stop date. The start is less than or equal to the stop. Delegates to start_date and stop_date.

@returns [Date,Date] a random [start date, stop date] from min..max

# File lib/sixarm_ruby_fab/date.rb, line 61
def start_date_and_stop_date(options = {})
  [start_date(options), stop_date(options)].sort
end
start_datetime(options = {}) click to toggle source

Fab a random start datetime. Delegates to datetime.

@returns [DateTime] a random datetime min..max

# File lib/sixarm_ruby_fab/datetime.rb, line 42
def start_datetime(options = {})
  datetime(options)
end
start_datetime_and_stop_datetime(options = {}) click to toggle source

Fab a random start datetime and stop datetime. The start is less than or equal to the stop. Delegates to start_datetime and stop_datetime.

@returns [DateTime,DateTime] a random [start datetime, stop datetime] from min..max

# File lib/sixarm_ruby_fab/datetime.rb, line 61
def start_datetime_and_stop_datetime(options = {})
  [start_datetime(options), stop_datetime(options)].sort
end
start_time(options = {}) click to toggle source

Fab a random start time. Delegates to time.

@returns [Time] a random time min..max

# File lib/sixarm_ruby_fab/time.rb, line 42
def start_time(options = {})
  time(options)
end
start_time_and_stop_time(options = {}) click to toggle source

Fab a random start time and stop time. The start is less than or equal to the stop. Delegates to start_time and stop_time.

@returns [Time,Time] a random [start time, stop time] from min..max

# File lib/sixarm_ruby_fab/time.rb, line 61
def start_time_and_stop_time(options = {})
  [start_time(options), stop_time(options)].sort
end
stop_date(options = {}) click to toggle source

Fab a random stop date. Delegates to date.

@returns [Date] a random date min..max

# File lib/sixarm_ruby_fab/date.rb, line 51
def stop_date(options = {})
  date(options)
end
stop_datetime(options = {}) click to toggle source

Fab a random stop datetime. Delegates to datetime.

@returns [DateTime] a random datetime min..max

# File lib/sixarm_ruby_fab/datetime.rb, line 51
def stop_datetime(options = {})
  datetime(options)
end
stop_time(options = {}) click to toggle source

Fab a random stop time. Delegates to time.

@returns [Time] a random time min..max

# File lib/sixarm_ruby_fab/time.rb, line 51
def stop_time(options = {})
  time(options)
end
street_address() click to toggle source

Fab a random street address. Delegates to Forgery::Address.street_address.

@returns [String] a random street address

# File lib/sixarm_ruby_fab/postal.rb, line 9
def street_address
  Forgery::Address.street_address 
end
sym() click to toggle source

Fab a symbol, such as :abcdefgh

@return [Symbol]

# File lib/sixarm_ruby_fab/basic.rb, line 16
def sym
  ('a'..'z').to_a.sample(rand(10..20)).join.to_sym
end
time(options = {}) click to toggle source

Fab a random time.

Options:

* min
* max

@returns [Time] a random time min..max

# File lib/sixarm_ruby_fab/time.rb, line 13
def time(options = {})
  rand((options[:min] || time_min)..(options[:max] || time_max))
end
time_max() click to toggle source

Get. The default is now + 1000.

# File lib/sixarm_ruby_fab/time.rb, line 28
def time_max
  @time_max ||= Time.now + 1000
end
time_max=(x) click to toggle source

Set.

# File lib/sixarm_ruby_fab/time.rb, line 33
def time_max=x
  @time_max=x
end
time_min() click to toggle source

Get. The default is now - 1000.

# File lib/sixarm_ruby_fab/time.rb, line 18
def time_min
  @time_min ||= Time.now - 1000
end
time_min=(x) click to toggle source

Set.

# File lib/sixarm_ruby_fab/time.rb, line 23
def time_min=x
  @time_min=x
end
timezone_database_name() click to toggle source
# File lib/sixarm_ruby_fab/timezone.rb, line 4
def timezone_database_name
  [
    "Africa/Abidjan",
    "Africa/Accra",
    "Africa/Algiers",
    "Africa/Bissau",
    "Africa/Cairo",
    "Africa/Casablanca",
    "Africa/Ceuta",
    "Africa/El_Aaiun",
    "Africa/Johannesburg",
    "Africa/Juba",
    "Africa/Khartoum",
    "Africa/Lagos",
    "Africa/Maputo",
    "Africa/Monrovia",
    "Africa/Nairobi",
    "Africa/Ndjamena",
    "Africa/Tripoli",
    "Africa/Tunis",
    "Africa/Windhoek",
    "America/Adak",
    "America/Anchorage",
    "America/Araguaina",
    "America/Argentina/Buenos_Aires",
    "America/Argentina/Catamarca",
    "America/Argentina/Cordoba",
    "America/Argentina/Jujuy",
    "America/Argentina/La_Rioja",
    "America/Argentina/Mendoza",
    "America/Argentina/Rio_Gallegos",
    "America/Argentina/Salta",
    "America/Argentina/San_Juan",
    "America/Argentina/San_Luis",
    "America/Argentina/Tucuman",
    "America/Argentina/Ushuaia",
    "America/Asuncion",
    "America/Atikokan",
    "America/Bahia",
    "America/Bahia_Banderas",
    "America/Barbados",
    "America/Belem",
    "America/Belize",
    "America/Blanc-Sablon",
    "America/Boa_Vista",
    "America/Bogota",
    "America/Boise",
    "America/Cambridge_Bay",
    "America/Campo_Grande",
    "America/Cancun",
    "America/Caracas",
    "America/Cayenne",
    "America/Chicago",
    "America/Chihuahua",
    "America/Costa_Rica",
    "America/Creston",
    "America/Cuiaba",
    "America/Curacao",
    "America/Danmarkshavn",
    "America/Dawson",
    "America/Dawson_Creek",
    "America/Denver",
    "America/Detroit",
    "America/Edmonton",
    "America/Eirunepe",
    "America/El_Salvador",
    "America/Fort_Nelson",
    "America/Fortaleza",
    "America/Glace_Bay",
    "America/Godthab",
    "America/Goose_Bay",
    "America/Grand_Turk",
    "America/Guatemala",
    "America/Guayaquil",
    "America/Guyana",
    "America/Halifax",
    "America/Havana",
    "America/Hermosillo",
    "America/Indiana/Indianapolis",
    "America/Indiana/Knox",
    "America/Indiana/Marengo",
    "America/Indiana/Petersburg",
    "America/Indiana/Tell_City",
    "America/Indiana/Vevay",
    "America/Indiana/Vincennes",
    "America/Indiana/Winamac",
    "America/Inuvik",
    "America/Iqaluit",
    "America/Jamaica",
    "America/Juneau",
    "America/Kentucky/Louisville",
    "America/Kentucky/Monticello",
    "America/La_Paz",
    "America/Lima",
    "America/Los_Angeles",
    "America/Maceio",
    "America/Managua",
    "America/Manaus",
    "America/Martinique",
    "America/Matamoros",
    "America/Mazatlan",
    "America/Menominee",
    "America/Merida",
    "America/Metlakatla",
    "America/Mexico_City",
    "America/Miquelon",
    "America/Moncton",
    "America/Monterrey",
    "America/Montevideo",
    "America/Nassau",
    "America/New_York",
    "America/Nipigon",
    "America/Nome",
    "America/Noronha",
    "America/North_Dakota/Beulah",
    "America/North_Dakota/Center",
    "America/North_Dakota/New_Salem",
    "America/Ojinaga",
    "America/Panama",
    "America/Pangnirtung",
    "America/Paramaribo",
    "America/Phoenix",
    "America/Port_of_Spain",
    "America/Port-au-Prince",
    "America/Porto_Velho",
    "America/Puerto_Rico",
    "America/Punta_Arenas",
    "America/Rainy_River",
    "America/Rankin_Inlet",
    "America/Recife",
    "America/Regina",
    "America/Resolute",
    "America/Rio_Branco",
    "America/Santarem",
    "America/Santiago",
    "America/Santo_Domingo",
    "America/Sao_Paulo",
    "America/Scoresbysund",
    "America/Sitka",
    "America/St_Johns",
    "America/Swift_Current",
    "America/Tegucigalpa",
    "America/Thule",
    "America/Thunder_Bay",
    "America/Tijuana",
    "America/Toronto",
    "America/Vancouver",
    "America/Whitehorse",
    "America/Winnipeg",
    "America/Yakutat",
    "America/Yellowknife",
    "Antarctica/Casey",
    "Antarctica/Davis",
    "Antarctica/DumontDUrville",
    "Antarctica/Macquarie",
    "Antarctica/Mawson",
    "Antarctica/Palmer",
    "Antarctica/Rothera",
    "Antarctica/Syowa",
    "Antarctica/Troll",
    "Antarctica/Vostok",
    "Asia/Almaty",
    "Asia/Amman",
    "Asia/Anadyr",
    "Asia/Aqtau",
    "Asia/Aqtobe",
    "Asia/Ashgabat",
    "Asia/Atyrau",
    "Asia/Baghdad",
    "Asia/Baku",
    "Asia/Bangkok",
    "Asia/Barnaul",
    "Asia/Beirut",
    "Asia/Bishkek",
    "Asia/Brunei",
    "Asia/Chita",
    "Asia/Choibalsan",
    "Asia/Colombo",
    "Asia/Damascus",
    "Asia/Dhaka",
    "Asia/Dili",
    "Asia/Dubai",
    "Asia/Dushanbe",
    "Asia/Famagusta",
    "Asia/Gaza",
    "Asia/Hebron",
    "Asia/Ho_Chi_Minh",
    "Asia/Hong_Kong",
    "Asia/Hovd",
    "Asia/Irkutsk",
    "Asia/Jakarta",
    "Asia/Jayapura",
    "Asia/Jerusalem",
    "Asia/Kabul",
    "Asia/Kamchatka",
    "Asia/Karachi",
    "Asia/Kathmandu",
    "Asia/Khandyga",
    "Asia/Kolkata",
    "Asia/Krasnoyarsk",
    "Asia/Kuala_Lumpur",
    "Asia/Kuching",
    "Asia/Macau",
    "Asia/Magadan",
    "Asia/Makassar",
    "Asia/Manila",
    "Asia/Novokuznetsk",
    "Asia/Novosibirsk",
    "Asia/Omsk",
    "Asia/Oral",
    "Asia/Pontianak",
    "Asia/Pyongyang",
    "Asia/Qatar",
    "Asia/Qyzylorda",
    "Asia/Riyadh",
    "Asia/Sakhalin",
    "Asia/Samarkand",
    "Asia/Seoul",
    "Asia/Shanghai",
    "Asia/Singapore",
    "Asia/Srednekolymsk",
    "Asia/Taipei",
    "Asia/Tashkent",
    "Asia/Tbilisi",
    "Asia/Tehran",
    "Asia/Thimphu",
    "Asia/Tokyo",
    "Asia/Tomsk",
    "Asia/Ulaanbaatar",
    "Asia/Urumqi",
    "Asia/Ust-Nera",
    "Asia/Vladivostok",
    "Asia/Yakutsk",
    "Asia/Yangon",
    "Asia/Yekaterinburg",
    "Asia/Yerevan",
    "Atlantic/Azores",
    "Atlantic/Bermuda",
    "Atlantic/Canary",
    "Atlantic/Cape_Verde",
    "Atlantic/Faroe",
    "Atlantic/Madeira",
    "Atlantic/Reykjavik",
    "Atlantic/South_Georgia",
    "Atlantic/Stanley",
    "Australia/Adelaide",
    "Australia/Brisbane",
    "Australia/Broken_Hill",
    "Australia/Currie",
    "Australia/Darwin",
    "Australia/Eucla",
    "Australia/Hobart",
    "Australia/Lindeman",
    "Australia/Lord_Howe",
    "Australia/Melbourne",
    "Australia/Perth",
    "Australia/Sydney",
    "Europe/Amsterdam",
    "Europe/Andorra",
    "Europe/Astrakhan",
    "Europe/Athens",
    "Europe/Belgrade",
    "Europe/Berlin",
    "Europe/Brussels",
    "Europe/Bucharest",
    "Europe/Budapest",
    "Europe/Chisinau",
    "Europe/Copenhagen",
    "Europe/Dublin",
    "Europe/Gibraltar",
    "Europe/Helsinki",
    "Europe/Istanbul",
    "Europe/Kaliningrad",
    "Europe/Kiev",
    "Europe/Kirov",
    "Europe/Lisbon",
    "Europe/London",
    "Europe/Luxembourg",
    "Europe/Madrid",
    "Europe/Malta",
    "Europe/Minsk",
    "Europe/Monaco",
    "Europe/Moscow",
    "Europe/Nicosia",
    "Europe/Oslo",
    "Europe/Paris",
    "Europe/Prague",
    "Europe/Riga",
    "Europe/Rome",
    "Europe/Samara",
    "Europe/Saratov",
    "Europe/Simferopol",
    "Europe/Sofia",
    "Europe/Stockholm",
    "Europe/Tallinn",
    "Europe/Tirane",
    "Europe/Ulyanovsk",
    "Europe/Uzhgorod",
    "Europe/Vienna",
    "Europe/Vilnius",
    "Europe/Volgograd",
    "Europe/Warsaw",
    "Europe/Zaporozhye",
    "Europe/Zurich",
    "Indian/Chagos",
    "Indian/Christmas",
    "Indian/Cocos",
    "Indian/Kerguelen",
    "Indian/Mahe",
    "Indian/Maldives",
    "Indian/Mauritius",
    "Indian/Reunion",
    "Pacific/Apia",
    "Pacific/Auckland",
    "Pacific/Bougainville",
    "Pacific/Chatham",
    "Pacific/Chuuk",
    "Pacific/Easter",
    "Pacific/Efate",
    "Pacific/Enderbury",
    "Pacific/Fakaofo",
    "Pacific/Fiji",
    "Pacific/Funafuti",
    "Pacific/Galapagos",
    "Pacific/Gambier",
    "Pacific/Guadalcanal",
    "Pacific/Guam",
    "Pacific/Honolulu",
    "Pacific/Kiritimati",
    "Pacific/Kosrae",
    "Pacific/Kwajalein",
    "Pacific/Majuro",
    "Pacific/Marquesas",
    "Pacific/Nauru",
    "Pacific/Niue",
    "Pacific/Norfolk",
    "Pacific/Noumea",
    "Pacific/Pago_Pago",
    "Pacific/Palau",
    "Pacific/Pitcairn",
    "Pacific/Pohnpei",
    "Pacific/Port_Moresby",
    "Pacific/Rarotonga",
    "Pacific/Tahiti",
    "Pacific/Tarawa",
    "Pacific/Tongatapu",
    "Pacific/Wake",
    "Pacific/Wallis",
  ].sample
end
title(options = {}) click to toggle source

Fab a random title.

Options:

* chars: NOTE_CHARS
* size: rand(10..50) [actual size may be less because we strip the string]

@returns [String] a random name

# File lib/sixarm_ruby_fab/text.rb, line 42
def title(options = {})
  (options[:chars] || NOTE_CHARS).sample(options[:size] || rand(10..50)).join.strip
end
twitter_favorite_count(options = {}) click to toggle source

Fab a Twitter favorite count.

Options:

* min: 0
* max: 999

@return [Integer] a favorite count

# File lib/sixarm_ruby_fab/twitter.rb, line 68
def twitter_favorite_count(options = {})
  rand((options[:min] || 0)..(options[:max] || 999))
end
twitter_retweet_count(options = {}) click to toggle source

Fab a Twitter retweet count.

Options:

* min: 0
* max: 999

@return [Integer] a retweet count

# File lib/sixarm_ruby_fab/twitter.rb, line 55
def twitter_retweet_count(options = {})
  rand((options[:min] || 0)..(options[:max] || 999))
end
twitter_screen_name(options = {}) click to toggle source

Fab a Twitter screen name. This delegates to Fab.username.

Options:

* none

@return [Integer] a screen name

# File lib/sixarm_ruby_fab/twitter.rb, line 13
def twitter_screen_name(options = {})
  username(options)
end
twitter_tweet_hash(options={}) click to toggle source

Fab a Twitter tweet hash.

Options:

* any; merge this hash into the tweet hash.

@return [Hash] a tweet hash

# File lib/sixarm_ruby_fab/twitter.rb, line 93
def twitter_tweet_hash(options={})
  id = options[:id] || options["id"] || Fab.twitter_tweet_id
  {
    "created_at" => Fab.time.httpdate,
    "id" => id.to_i,
    "id_str" => id.to_s,
    "text" => Fab.lorem,
    "source" => "web",
    "truncated" => false,
    "in_reply_to_status_id" => nil,
    "in_reply_to_status_id_str" => nil,
    "in_reply_to_user_id" => nil,
    "in_reply_to_user_id_str" => nil,
    "in_reply_to_screen_name" => nil,
    "user" => Fab.twitter_user_hash,
    "geo" => nil,
    "coordinates" => nil,
    "place" => nil,
    "contributors" => nil,
    "retweet_count" => Fab.twitter_retweet_count,
    "favorite_count" => Fab.twitter_favorite_count,
    "favorited" => Fab.boolean,
    "retweeted" => Fab.boolean,
    "lang" => Fab.language_code
  }.merge(options)
end
twitter_tweet_id(options = {}) click to toggle source

Fab a Twitter tweet id.

Options:

* min: 1000000000
* max: 9000000000

@return [Integer] a tweet id

# File lib/sixarm_ruby_fab/twitter.rb, line 81
def twitter_tweet_id(options = {})
  rand((options[:min] || 1000000000)..(options[:max] || 9000000000))
end
twitter_user_hash(options = {}) click to toggle source

Fab a Twitter user hash.

Options:

* any; merge this hash into the user hash.

@return [Hash] a Twitter user hash

# File lib/sixarm_ruby_fab/twitter.rb, line 38
def twitter_user_hash(options = {})
  id = options[:id] || options["id"] || twitter_user_id
  {
    "id" => id.to_i,
    "id_str" => id.to_s
  }.merge(options)
end
twitter_user_id(options = {}) click to toggle source

Fab a Twitter user id.

Options:

* min
* max

@return [Integer] a user id

# File lib/sixarm_ruby_fab/twitter.rb, line 26
def twitter_user_id(options = {})
  rand((options[:min] || 10000000)..(options[:max] || 100000000))
end
uri() click to toggle source

Fab a random URI. Delegates to Forgery::Internet.uri.

@returns [String] a URI

# File lib/sixarm_ruby_fab/internet.rb, line 9
def uri 
  Forgery::Internet.uri
end
username(options = {}) click to toggle source

Fab a username.

Options:

* chars: a..z
* size: rand(10..30) [actual size may be less because we strip the string]

@returns [String] a username

# File lib/sixarm_ruby_fab/username.rb, line 13
def username(options = {})
  (options[:chars] || AZ).sample(options[:size] || rand(5..15)).join
end
usstate() click to toggle source

Fab a random US state abbreviation. Delegates to Forgery::Address.state_abbrev.

@returns [String] a random US state abbreviation

# File lib/sixarm_ruby_fab/postal.rb, line 27
def usstate 
  Forgery::Address.state_abbrev 
end
uszip() click to toggle source

Fab a random US zip code. Delegates to Forgery::Address.zip.

@returns [String] a random US zip code

# File lib/sixarm_ruby_fab/postal.rb, line 36
def uszip
  Forgery::Address.zip 
end
uuid(options = {}) click to toggle source

Fab a random UUID.

Options:

* none

@returns [String] a random UUID sting

# File lib/sixarm_ruby_fab/uuid.rb, line 12
def uuid(options = {})
  SecureRandom.uuid
end
uuids(options = {}) click to toggle source

Fab a list of random UUIDs.

Options:

* size: 3

@returns [Array] a list of random UUIDs

# File lib/sixarm_ruby_fab/uuid.rb, line 24
def uuids(options = {})
  (options[:size] || 3).times.map{ uuid(options) }
end