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: 'm' }
].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, underscore
#fetch_sample, #rand, #shuffle
Methods included from Unit
#temperature_abbr, #temperature_name, #time_abbr, #time_name
Instance Method Details
#area_abbr ⇒ Object
84
85
86
|
# File 'lib/ffaker/unit_english.rb', line 84
def area_abbr
area.abbreviation
end
|
#area_name ⇒ Object
80
81
82
|
# File 'lib/ffaker/unit_english.rb', line 80
def area_name
area.name
end
|
#length_abbr ⇒ Object
60
61
62
|
# File 'lib/ffaker/unit_english.rb', line 60
def length_abbr
length.abbreviation
end
|
#length_name ⇒ Object
56
57
58
|
# File 'lib/ffaker/unit_english.rb', line 56
def length_name
length.name
end
|
#liquid_abbr ⇒ Object
68
69
70
|
# File 'lib/ffaker/unit_english.rb', line 68
def liquid_abbr
liquid.abbreviation
end
|
#liquid_name ⇒ Object
64
65
66
|
# File 'lib/ffaker/unit_english.rb', line 64
def liquid_name
liquid.name
end
|
#mass_abbr ⇒ Object
52
53
54
|
# File 'lib/ffaker/unit_english.rb', line 52
def mass_abbr
mass.abbreviation
end
|
#mass_name ⇒ Object
48
49
50
|
# File 'lib/ffaker/unit_english.rb', line 48
def mass_name
mass.name
end
|
#volume_abbr ⇒ Object
76
77
78
|
# File 'lib/ffaker/unit_english.rb', line 76
def volume_abbr
volume.abbreviation
end
|
#volume_name ⇒ Object
72
73
74
|
# File 'lib/ffaker/unit_english.rb', line 72
def volume_name
volume.name
end
|