From d10b73ad26a089a1d9d20fea5ff3367d69525f82 Mon Sep 17 00:00:00 2001 From: Lucas Sapienza Date: Fri, 11 Oct 2019 16:31:54 -0300 Subject: [PATCH 1/4] add food docs --- lib/faker/default/food.rb | 66 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 65 insertions(+), 1 deletion(-) diff --git a/lib/faker/default/food.rb b/lib/faker/default/food.rb index ccec4ac139..aa99df96b4 100644 --- a/lib/faker/default/food.rb +++ b/lib/faker/default/food.rb @@ -5,42 +5,106 @@ class Food < Base flexible :food class << self - # Retrieves a typical dish from each country + ## + # Retrieves a typical dish from each country. + # + # @return [String] + # + # @example + # Faker::Food.dish #=> "Feijoada" + # + # @faker.version 2.6.0 def dish fetch('food.dish') end + ## # Retrieves a description about some dish + # + # @return [String] + # + # @example + # Faker::Food.descriptions #=> "Breaded fried chicken with waffles. Served with maple syrup." + # + # @faker.version 2.6.0 def description fetch('food.descriptions') end + ## # Retrieves an ingredient + # + # @return [String] + # + # @example + # Faker::Food.ingredients #=> "Olives" + # + # @faker.version 2.6.0 def ingredient fetch('food.ingredients') end + ## # Retrieves a fruit + # + # @return [String] + # + # @example + # Faker::Food.fruits #=> "Papaya" + # + # @faker.version 2.6.0 def fruits fetch('food.fruits') end + ## # Retrieves a vegetable + # + # @return [String] + # + # @example + # Faker::Food.vegetables #=> "Broccolini" + # + # @faker.version 2.6.0 def vegetables fetch('food.vegetables') end + ## # Retrieves some random spice + # + # @return [String] + # + # @example + # Faker::Food.spices #=> "Garlic Chips" + # + # @faker.version 2.6.0 def spice fetch('food.spices') end + ## # Retrieves cooking measures + # + # @return [String] + # + # @example + # Faker::Food.measurement_sizes #=> "1/3" + # + # @faker.version 2.6.0 def measurement fetch('food.measurement_sizes') + ' ' + fetch('food.measurements') end + ## # Retrieves metric mesurements + # + # @return [String] + # + # @example + # Faker::Food.metric_measurements #=> "centiliter" + # + # @faker.version 2.6.0 def metric_measurement fetch('food.metric_measurements') end From 1b7afe79c1c04bd326ca804a424afb4fa4a961d3 Mon Sep 17 00:00:00 2001 From: Lucas Sapienza Date: Tue, 12 Nov 2019 22:18:10 -0300 Subject: [PATCH 2/4] Apply suggestions from code review Co-Authored-By: Connor Shea --- lib/faker/default/food.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/faker/default/food.rb b/lib/faker/default/food.rb index aa99df96b4..fee202e438 100644 --- a/lib/faker/default/food.rb +++ b/lib/faker/default/food.rb @@ -24,7 +24,7 @@ def dish # @return [String] # # @example - # Faker::Food.descriptions #=> "Breaded fried chicken with waffles. Served with maple syrup." + # Faker::Food.description #=> "Breaded fried chicken with waffles. Served with maple syrup." # # @faker.version 2.6.0 def description @@ -37,7 +37,7 @@ def description # @return [String] # # @example - # Faker::Food.ingredients #=> "Olives" + # Faker::Food.ingredient #=> "Olives" # # @faker.version 2.6.0 def ingredient From 218368332a31ef605aada0a2bd987a797fd3b19e Mon Sep 17 00:00:00 2001 From: Lucas Sapienza Date: Tue, 12 Nov 2019 22:19:00 -0300 Subject: [PATCH 3/4] Apply suggestions from code review Co-Authored-By: Connor Shea --- lib/faker/default/food.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/faker/default/food.rb b/lib/faker/default/food.rb index fee202e438..c4a123261e 100644 --- a/lib/faker/default/food.rb +++ b/lib/faker/default/food.rb @@ -76,7 +76,7 @@ def vegetables # @return [String] # # @example - # Faker::Food.spices #=> "Garlic Chips" + # Faker::Food.spice #=> "Garlic Chips" # # @faker.version 2.6.0 def spice @@ -89,7 +89,7 @@ def spice # @return [String] # # @example - # Faker::Food.measurement_sizes #=> "1/3" + # Faker::Food.measurement #=> "1/3" # # @faker.version 2.6.0 def measurement @@ -102,7 +102,7 @@ def measurement # @return [String] # # @example - # Faker::Food.metric_measurements #=> "centiliter" + # Faker::Food.metric_measurement #=> "centiliter" # # @faker.version 2.6.0 def metric_measurement From 0922afaa27765a8a46df61f88905fb5b7b180276 Mon Sep 17 00:00:00 2001 From: Lucas Sapienza Date: Thu, 14 Nov 2019 11:07:00 -0300 Subject: [PATCH 4/4] Apply suggestions from code review --- lib/faker/default/food.rb | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/lib/faker/default/food.rb b/lib/faker/default/food.rb index c4a123261e..d50125aab7 100644 --- a/lib/faker/default/food.rb +++ b/lib/faker/default/food.rb @@ -13,7 +13,7 @@ class << self # @example # Faker::Food.dish #=> "Feijoada" # - # @faker.version 2.6.0 + # @faker.version 1.8.0 def dish fetch('food.dish') end @@ -26,7 +26,7 @@ def dish # @example # Faker::Food.description #=> "Breaded fried chicken with waffles. Served with maple syrup." # - # @faker.version 2.6.0 + # @faker.version 1.9.0 def description fetch('food.descriptions') end @@ -39,7 +39,7 @@ def description # @example # Faker::Food.ingredient #=> "Olives" # - # @faker.version 2.6.0 + # @faker.version 1.7.0 def ingredient fetch('food.ingredients') end @@ -52,7 +52,7 @@ def ingredient # @example # Faker::Food.fruits #=> "Papaya" # - # @faker.version 2.6.0 + # @faker.version 1.9.0 def fruits fetch('food.fruits') end @@ -65,7 +65,7 @@ def fruits # @example # Faker::Food.vegetables #=> "Broccolini" # - # @faker.version 2.6.0 + # @faker.version 1.9.0 def vegetables fetch('food.vegetables') end @@ -78,7 +78,7 @@ def vegetables # @example # Faker::Food.spice #=> "Garlic Chips" # - # @faker.version 2.6.0 + # @faker.version 1.7.0 def spice fetch('food.spices') end @@ -91,7 +91,7 @@ def spice # @example # Faker::Food.measurement #=> "1/3" # - # @faker.version 2.6.0 + # @faker.version 1.7.0 def measurement fetch('food.measurement_sizes') + ' ' + fetch('food.measurements') end @@ -104,7 +104,7 @@ def measurement # @example # Faker::Food.metric_measurement #=> "centiliter" # - # @faker.version 2.6.0 + # @faker.version 1.8.3 def metric_measurement fetch('food.metric_measurements') end