Sha256: 9eb4234f236d307fc2697a22613e0ae2f7ba68b788ab50fb61c5b9c16b38b103

Contents?: true

Size: 991 Bytes

Versions: 6

Compression:

Stored size: 991 Bytes

Contents

# frozen_string_literal: true

module FFaker
  module NameRU
    extend ModuleUtils
    extend self

    FIRST_NAMES = FIRST_NAMES_MALE + FIRST_NAMES_FEMALE
    LAST_NAMES = LAST_NAMES_MALE + LAST_NAMES_FEMALE

    def name
      rand(0..1).zero? ? female_name : male_name
    end

    def first_name
      fetch_sample(FIRST_NAMES)
    end

    def last_name
      fetch_sample(LAST_NAMES)
    end

    def female_name
      "#{first_name_female} #{last_name_female}"
    end

    def male_name
      "#{first_name_male} #{last_name_male}"
    end

    def first_name_female
      fetch_sample(FIRST_NAMES_FEMALE)
    end

    def first_name_male
      fetch_sample(FIRST_NAMES_MALE)
    end

    def middle_name_female
      fetch_sample(MIDDLE_NAMES_FEMALE)
    end

    def middle_name_male
      fetch_sample(MIDDLE_NAMES_MALE)
    end

    def last_name_female
      fetch_sample(LAST_NAMES_FEMALE)
    end

    def last_name_male
      fetch_sample(LAST_NAMES_MALE)
    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ffaker-2.23.0 lib/ffaker/name_ru.rb
ffaker-2.22.0 lib/ffaker/name_ru.rb
ffaker-2.21.0 lib/ffaker/name_ru.rb
ffaker-2.20.0 lib/ffaker/name_ru.rb
ffaker-2.19.0 lib/ffaker/name_ru.rb
ffaker-2.18.0 lib/ffaker/name_ru.rb