Class: Faker::Currency

Inherits:
Base
  • Object
show all
Defined in:
lib/faker/default/currency.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, letterify, method_missing, numerify, parse, rand, rand_in_range, regexify, resolve, respond_to_missing?, sample, shuffle, translate, unique, with_locale

Class Method Details

.codeString

Produces a currency code.

Examples:

Faker::Currency.code #=> "USD"

Returns:

  • (String)

Available since:

  • 1.9.0


28
29
30
# File 'lib/faker/default/currency.rb', line 28

def code
  fetch('currency.code')
end

.nameString

Produces the name of a currency.

Examples:

Faker::Currency.name #=> "Swedish Krona"

Returns:

  • (String)

Available since:

  • 1.9.0


15
16
17
# File 'lib/faker/default/currency.rb', line 15

def name
  fetch('currency.name')
end

.symbolString

Produces a currency symbol.

Examples:

Faker::Currency.symbol #=> "$"

Returns:

  • (String)

Available since:

  • 1.9.0


41
42
43
# File 'lib/faker/default/currency.rb', line 41

def symbol
  fetch('currency.symbol')
end