Class: Faker::Travel::Airport

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/travel/airport.rb

Constant Summary

Constants inherited from Base

Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters

Class Method Summary collapse

Methods inherited from Base

bothify, disable_enforce_available_locales, fetch, fetch_all, flexible, generate, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, shuffle!, translate, unique, with_locale

Class Method Details

.iata(size:, region:) ⇒ String

Produces random Airport by IATA code and takes arguments for size and region

Faker::Travel::Airport.iata(size: ‘large’, region: ‘united_states’) => “LAX”

Parameters:

  • size (String)

    airport size, united_states has large, or medium, or small, european_union has large, or medium

  • region (String)

    airport region, currently available -> united_states or european_union

Returns:

  • (String)

Available since:

  • next



37
38
39
# File 'lib/faker/travel/airport.rb', line 37

def iata(size:, region:)
  fetch("airport.#{region}.iata_code.#{size}")
end

.name(size:, region:) ⇒ String

Produces random Airport by name and takes arguments for size and region

Faker::Travel::Airport.name(size: ‘large’, region: ‘united_states’) => “Los Angeles International Airport”

Parameters:

  • size (String)

    airport size, united_states has large, or medium, or small, european_union has large, or medium

  • region (String)

    airport region, currently available -> united_states or european_union

Returns:

  • (String)

Available since:

  • next



20
21
22
# File 'lib/faker/travel/airport.rb', line 20

def name(size:, region:)
  fetch("airport.#{region}.#{size}")
end