Sha256: 8378484e46c9bc3c67cdc414d5d6694e8c1935bf2b2931a19a430b3649ad6e3b

Contents?: true

Size: 1.4 KB

Versions: 8

Compression:

Stored size: 1.4 KB

Contents

# frozen_string_literal: true

module Faker
  class Travel
    class Airport < Base
      class << self
        ##
        # Produces random Airport by name and takes arguments for size and region
        #
        # @param size [String] airport size, united_states has large, or medium, or small, european_union has large, or medium
        #
        # @param region [String] airport region, currently available -> united_states or european_union
        #
        # @return [String]
        #
        # @example
        # Faker::Travel::Airport.name(size: 'large', region: 'united_states') => "Los Angeles International Airport"
        #
        # @faker.version next
        def name(size:, region:)
          fetch("airport.#{region}.#{size}")
        end

        ##
        # Produces random Airport by IATA code and takes arguments for size and region
        #
        # @param size [String] airport size, united_states has large, or medium, or small, european_union has large, or medium
        #
        # @param region [String] airport region, currently available -> united_states or european_union
        #
        # @return [String]
        #
        # @example
        # Faker::Travel::Airport.iata(size: 'large', region: 'united_states') => "LAX"
        #
        # @faker.version next
        def iata(size:, region:)
          fetch("airport.#{region}.iata_code.#{size}")
        end
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
faker-3.5.1 lib/faker/travel/airport.rb
faker-3.4.2 lib/faker/travel/airport.rb
faker-3.4.1 lib/faker/travel/airport.rb
faker-3.3.1 lib/faker/travel/airport.rb
faker-3.3.0 lib/faker/travel/airport.rb
faker-3.2.3 lib/faker/travel/airport.rb
faker-3.2.2 lib/faker/travel/airport.rb
faker-3.2.1 lib/faker/travel/airport.rb