Class: Faker::Measurement
Constant Summary collapse
- ALL =
'all'
- NONE =
'none'
Constants inherited from Base
Base::LLetters, Base::Letters, Base::NOT_GIVEN, Base::Numbers, Base::ULetters
Class Method Summary collapse
-
.height(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random height measurement.
-
.length(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random length measurement.
-
.metric_height(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random metric height measurement.
-
.metric_length(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random metric length measurement.
-
.metric_volume(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random metric volume measurement.
-
.metric_weight(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random metric weight measurement.
-
.volume(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random volume measurement.
-
.weight(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random weight measurement.
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
.height(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random height measurement.
22 23 24 25 26 27 28 |
# File 'lib/faker/default/measurement.rb', line 22 def height(legacy_amount = NOT_GIVEN, amount: rand(10)) warn_for_deprecated_arguments do |keywords| keywords << :amount if legacy_amount != NOT_GIVEN end define_measurement_locale(amount, 'height') end |
.length(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random length measurement.
41 42 43 44 45 46 47 |
# File 'lib/faker/default/measurement.rb', line 41 def length(legacy_amount = NOT_GIVEN, amount: rand(10)) warn_for_deprecated_arguments do |keywords| keywords << :amount if legacy_amount != NOT_GIVEN end define_measurement_locale(amount, 'length') end |
.metric_height(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random metric height measurement.
98 99 100 101 102 103 104 |
# File 'lib/faker/default/measurement.rb', line 98 def metric_height(legacy_amount = NOT_GIVEN, amount: rand(10)) warn_for_deprecated_arguments do |keywords| keywords << :amount if legacy_amount != NOT_GIVEN end define_measurement_locale(amount, 'metric_height') end |
.metric_length(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random metric length measurement.
117 118 119 120 121 122 123 |
# File 'lib/faker/default/measurement.rb', line 117 def metric_length(legacy_amount = NOT_GIVEN, amount: rand(10)) warn_for_deprecated_arguments do |keywords| keywords << :amount if legacy_amount != NOT_GIVEN end define_measurement_locale(amount, 'metric_length') end |
.metric_volume(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random metric volume measurement.
136 137 138 139 140 141 142 |
# File 'lib/faker/default/measurement.rb', line 136 def metric_volume(legacy_amount = NOT_GIVEN, amount: rand(10)) warn_for_deprecated_arguments do |keywords| keywords << :amount if legacy_amount != NOT_GIVEN end define_measurement_locale(amount, 'metric_volume') end |
.metric_weight(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random metric weight measurement.
155 156 157 158 159 160 161 |
# File 'lib/faker/default/measurement.rb', line 155 def metric_weight(legacy_amount = NOT_GIVEN, amount: rand(10)) warn_for_deprecated_arguments do |keywords| keywords << :amount if legacy_amount != NOT_GIVEN end define_measurement_locale(amount, 'metric_weight') end |
.volume(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random volume measurement.
60 61 62 63 64 65 66 |
# File 'lib/faker/default/measurement.rb', line 60 def volume(legacy_amount = NOT_GIVEN, amount: rand(10)) warn_for_deprecated_arguments do |keywords| keywords << :amount if legacy_amount != NOT_GIVEN end define_measurement_locale(amount, 'volume') end |
.weight(legacy_amount = NOT_GIVEN, amount: rand(10)) ⇒ String
Produces a random weight measurement.
79 80 81 82 83 84 85 |
# File 'lib/faker/default/measurement.rb', line 79 def weight(legacy_amount = NOT_GIVEN, amount: rand(10)) warn_for_deprecated_arguments do |keywords| keywords << :amount if legacy_amount != NOT_GIVEN end define_measurement_locale(amount, 'weight') end |