Module: FFaker::UnitEnglish
Constant Summary
collapse
- LENGTH_UNITS =
[
{ name: 'inch', abbreviation: 'in' },
{ name: 'foot', abbreviation: 'ft' },
{ name: 'yard', abbreviation: 'yd' },
{ name: 'furlong', abbreviation: 'fur' },
{ name: 'mile', abbreviation: 'mi' }
].freeze
- MASS_UNITS =
[
{ name: 'grains', abbreviation: 'gr' },
{ name: 'ounces', abbreviation: 'oz' },
{ name: 'pounds', abbreviation: 'lb' },
{ name: 'hundredweight', abbreviation: 'cwt' },
{ name: 'ton', abbreviation: 't' }
].freeze
- LIQUID_UNITS =
[
{ name: 'fluid ounce', abbreviation: 'fl oz' },
{ name: 'gill', abbreviation: 'gi' },
{ name: 'pint', abbreviation: 'pt' },
{ name: 'quart', abbreviation: 'qt' }
].freeze
- VOLUME_UNITS =
[
{ name: 'cubic inch', abbreviation: 'CI' },
{ name: 'cubic foot', abbreviation: 'CFT' },
{ name: 'cubic yard', abbreviation: 'CY' }
].freeze
- AREA_UNITS =
[
{ name: 'square inch', abbreviation: 'sq in' },
{ name: 'square foot', abbreviation: 'sq ft' },
{ name: 'square yard', abbreviation: 'sq yd' },
{ name: 'acre', abbreviation: 'ac' },
{ name: 'section', abbreviation: 's' },
{ name: 'square mile', abbreviation: 'sq mi' },
{ name: 'township', abbreviation: 'twp' }
].freeze
Constants included
from Unit
FFaker::Unit::TEMPERATURE_UNITS, FFaker::Unit::TIME_UNITS
Instance Method Summary
collapse
const_missing, k, luhn_check, underscore, unique
#fetch_sample, #rand, #shuffle
Methods included from Unit
#temperature_abbr, #temperature_name, #time_abbr, #time_name
Instance Method Details
#area_abbr ⇒ Object
81
82
83
|
# File 'lib/ffaker/unit_english.rb', line 81
def area_abbr
area[:abbreviation]
end
|
#area_name ⇒ Object
77
78
79
|
# File 'lib/ffaker/unit_english.rb', line 77
def area_name
area[:name]
end
|
#length_abbr ⇒ Object
57
58
59
|
# File 'lib/ffaker/unit_english.rb', line 57
def length_abbr
length[:abbreviation]
end
|
#length_name ⇒ Object
53
54
55
|
# File 'lib/ffaker/unit_english.rb', line 53
def length_name
length[:name]
end
|
#liquid_abbr ⇒ Object
65
66
67
|
# File 'lib/ffaker/unit_english.rb', line 65
def liquid_abbr
liquid[:abbreviation]
end
|
#liquid_name ⇒ Object
61
62
63
|
# File 'lib/ffaker/unit_english.rb', line 61
def liquid_name
liquid[:name]
end
|
#mass_abbr ⇒ Object
49
50
51
|
# File 'lib/ffaker/unit_english.rb', line 49
def mass_abbr
mass[:abbreviation]
end
|
#mass_name ⇒ Object
45
46
47
|
# File 'lib/ffaker/unit_english.rb', line 45
def mass_name
mass[:name]
end
|
#volume_abbr ⇒ Object
73
74
75
|
# File 'lib/ffaker/unit_english.rb', line 73
def volume_abbr
volume[:abbreviation]
end
|
#volume_name ⇒ Object
69
70
71
|
# File 'lib/ffaker/unit_english.rb', line 69
def volume_name
volume[:name]
end
|