faker 2.14.0 → 2.18.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (194) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +218 -19
  3. data/History.md +4 -4
  4. data/README.md +18 -1
  5. data/lib/faker.rb +12 -13
  6. data/lib/faker/blockchain/aeternity.rb +4 -4
  7. data/lib/faker/blockchain/bitcoin.rb +2 -2
  8. data/lib/faker/blockchain/tezos.rb +30 -2
  9. data/lib/faker/books/dune.rb +15 -2
  10. data/lib/faker/books/lovecraft.rb +8 -4
  11. data/lib/faker/creature/bird.rb +203 -0
  12. data/lib/faker/default/address.rb +4 -4
  13. data/lib/faker/default/app.rb +1 -1
  14. data/lib/faker/default/avatar.rb +1 -1
  15. data/lib/faker/default/bank.rb +20 -6
  16. data/lib/faker/default/barcode.rb +44 -33
  17. data/lib/faker/default/beer.rb +3 -3
  18. data/lib/faker/default/camera.rb +46 -0
  19. data/lib/faker/default/cannabis.rb +10 -0
  20. data/lib/faker/default/chile_rut.rb +3 -2
  21. data/lib/faker/default/chuck_norris.rb +1 -0
  22. data/lib/faker/default/code.rb +5 -5
  23. data/lib/faker/default/commerce.rb +1 -1
  24. data/lib/faker/default/company.rb +58 -10
  25. data/lib/faker/default/crypto.rb +17 -4
  26. data/lib/faker/default/driving_licence.rb +4 -3
  27. data/lib/faker/default/drone.rb +25 -25
  28. data/lib/faker/default/educator.rb +13 -0
  29. data/lib/faker/default/faker_adjective.rb +35 -0
  30. data/lib/faker/default/file.rb +6 -4
  31. data/lib/faker/default/finance.rb +21 -0
  32. data/lib/faker/default/food.rb +1 -1
  33. data/lib/faker/default/hipster.rb +14 -11
  34. data/lib/faker/default/id_number.rb +36 -2
  35. data/lib/faker/default/internet.rb +232 -6
  36. data/lib/faker/default/invoice.rb +1 -1
  37. data/lib/faker/default/json.rb +7 -6
  38. data/lib/faker/default/lorem.rb +160 -5
  39. data/lib/faker/default/lorem_flickr.rb +3 -8
  40. data/lib/faker/default/lorem_pixel.rb +2 -1
  41. data/lib/faker/default/markdown.rb +4 -2
  42. data/lib/faker/default/measurement.rb +3 -2
  43. data/lib/faker/default/military.rb +26 -0
  44. data/lib/faker/default/mountain.rb +33 -0
  45. data/lib/faker/default/number.rb +23 -6
  46. data/lib/faker/default/omniauth.rb +5 -10
  47. data/lib/faker/default/placeholdit.rb +3 -2
  48. data/lib/faker/default/relationship.rb +1 -1
  49. data/lib/faker/default/science.rb +26 -0
  50. data/lib/faker/default/space.rb +1 -1
  51. data/lib/faker/default/string.rb +3 -2
  52. data/lib/faker/default/stripe.rb +3 -3
  53. data/lib/faker/default/tea.rb +41 -0
  54. data/lib/faker/default/types.rb +4 -3
  55. data/lib/faker/default/vehicle.rb +1 -1
  56. data/lib/faker/fantasy/tolkien.rb +67 -0
  57. data/lib/faker/games/clash_of_clans.rb +48 -0
  58. data/lib/faker/games/control.rb +1 -1
  59. data/lib/faker/games/dnd.rb +6 -6
  60. data/lib/faker/games/elder_scrolls.rb +26 -0
  61. data/lib/faker/games/heroes.rb +13 -0
  62. data/lib/faker/games/minecraft.rb +65 -0
  63. data/lib/faker/games/street_fighter.rb +4 -4
  64. data/lib/faker/games/super_mario.rb +48 -0
  65. data/lib/faker/games/touhou.rb +75 -0
  66. data/lib/faker/games/witcher.rb +39 -0
  67. data/lib/faker/games/world_of_warcraft.rb +26 -1
  68. data/lib/faker/japanese_media/conan.rb +48 -0
  69. data/lib/faker/japanese_media/doraemon.rb +48 -0
  70. data/lib/faker/japanese_media/dragon_ball.rb +26 -0
  71. data/lib/faker/japanese_media/naruto.rb +61 -0
  72. data/lib/faker/japanese_media/studio_ghibli.rb +48 -0
  73. data/lib/faker/movies/hobbit.rb +4 -4
  74. data/lib/faker/movies/how_to_train_your_dragon.rb +48 -0
  75. data/lib/faker/movies/lord_of_the_rings.rb +3 -3
  76. data/lib/faker/movies/room.rb +63 -0
  77. data/lib/faker/movies/star_wars.rb +74 -2
  78. data/lib/faker/music/hiphop.rb +48 -0
  79. data/lib/faker/music/music.rb +12 -0
  80. data/lib/faker/music/opera.rb +237 -1
  81. data/lib/faker/music/rock_band.rb +12 -0
  82. data/lib/faker/quotes/quote.rb +26 -0
  83. data/lib/faker/quotes/rajnikanth.rb +1 -0
  84. data/lib/faker/quotes/shakespeare.rb +34 -0
  85. data/lib/faker/sports/volleyball.rb +74 -0
  86. data/lib/faker/tv_shows/big_bang_theory.rb +1 -1
  87. data/lib/faker/tv_shows/buffy.rb +17 -4
  88. data/lib/faker/tv_shows/final_space.rb +51 -0
  89. data/lib/faker/tv_shows/suits.rb +1 -1
  90. data/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +17 -4
  91. data/lib/faker/version.rb +1 -1
  92. data/lib/locales/en-US.yml +1 -1
  93. data/lib/locales/en/adjective.yml +179 -0
  94. data/lib/locales/en/bird.yml +1281 -0
  95. data/lib/locales/en/book.yml +487 -3
  96. data/lib/locales/en/buffy.yml +1 -1
  97. data/lib/locales/en/camera.yml +611 -0
  98. data/lib/locales/en/clash_of_clan.yml +101 -0
  99. data/lib/locales/en/company.yml +2 -2
  100. data/lib/locales/en/conan.yml +171 -0
  101. data/lib/locales/en/demographic.yml +218 -5
  102. data/lib/locales/en/device.yml +112 -4
  103. data/lib/locales/en/doraemon.yml +286 -0
  104. data/lib/locales/en/dota.yml +531 -63
  105. data/lib/locales/en/dragon_ball.yml +243 -1
  106. data/lib/locales/en/driving_license.yml +3 -0
  107. data/lib/locales/en/dune.yml +270 -131
  108. data/lib/locales/en/educator.yml +6 -0
  109. data/lib/locales/en/elder_scrolls.yml +583 -9
  110. data/lib/locales/en/fallout.yml +311 -133
  111. data/lib/locales/en/final_space.yml +37 -0
  112. data/lib/locales/en/finance.yml +53 -0
  113. data/lib/locales/en/football.yml +3 -3
  114. data/lib/locales/en/fresh_prince_of_bel_air.yml +1 -1
  115. data/lib/locales/en/half_life.yml +84 -3
  116. data/lib/locales/en/heroes.yml +408 -3
  117. data/lib/locales/en/heroes_of_the_storm.yml +131 -4
  118. data/lib/locales/en/how_to_train_your_dragon.yml +174 -0
  119. data/lib/locales/en/jack_handey.yml +54 -0
  120. data/lib/locales/en/league_of_legends.yml +285 -6
  121. data/lib/locales/en/lebowski.yml +1 -1
  122. data/lib/locales/en/lovecraft.yml +76 -6
  123. data/lib/locales/en/military.yml +179 -5
  124. data/lib/locales/en/minecraft.yml +273 -0
  125. data/lib/locales/en/mountain.yml +158 -0
  126. data/lib/locales/en/music.yml +461 -29
  127. data/lib/locales/en/myst.yml +87 -31
  128. data/lib/locales/en/naruto.yml +231 -0
  129. data/lib/locales/en/opera.yml +168 -0
  130. data/lib/locales/en/overwatch.yml +2650 -2622
  131. data/lib/locales/en/pokemon.yml +417 -4
  132. data/lib/locales/en/quote.yml +692 -163
  133. data/lib/locales/en/rock_band.yml +1 -0
  134. data/lib/locales/en/room.yml +68 -0
  135. data/lib/locales/en/science.yml +355 -3
  136. data/lib/locales/en/shakespeare.yml +21 -24
  137. data/lib/locales/en/source.yml +30 -0
  138. data/lib/locales/en/space.yml +1 -1
  139. data/lib/locales/en/star_trek.yml +1 -1
  140. data/lib/locales/en/street_fighter.yml +4 -4
  141. data/lib/locales/en/studio_ghibli.yml +107 -0
  142. data/lib/locales/en/super_mario.yml +58 -0
  143. data/lib/locales/en/super_smash_bros.yml +18 -4
  144. data/lib/locales/en/tea.yml +172 -0
  145. data/lib/locales/en/tolkien.yml +2453 -0
  146. data/lib/locales/en/touhou.yml +839 -0
  147. data/lib/locales/en/volleyball.yml +501 -0
  148. data/lib/locales/en/witcher.yml +426 -7
  149. data/lib/locales/en/world_of_warcraft.yml +122 -4
  150. data/lib/locales/en/zelda.yml +962 -4
  151. data/lib/locales/es-AR.yml +4603 -0
  152. data/lib/locales/es.yml +56 -0
  153. data/lib/locales/fr.yml +0 -118
  154. data/lib/locales/fr/address.yml +21 -0
  155. data/lib/locales/fr/book.yml +7 -0
  156. data/lib/locales/fr/color.yml +4 -0
  157. data/lib/locales/fr/company.yml +17 -0
  158. data/lib/locales/fr/compass.yml +23 -0
  159. data/lib/locales/fr/demographic.yml +4 -0
  160. data/lib/locales/fr/gender.yml +6 -0
  161. data/lib/locales/fr/internet.yml +5 -0
  162. data/lib/locales/fr/lorem.yml +5 -0
  163. data/lib/locales/fr/measurement.yml +7 -0
  164. data/lib/locales/fr/name.yml +21 -0
  165. data/lib/locales/fr/phone_number.yml +7 -0
  166. data/lib/locales/fr/pokemon.yml +9 -0
  167. data/lib/locales/id.yml +1 -0
  168. data/lib/locales/ja/README.md +13 -0
  169. data/lib/locales/ja/address.yml +17 -0
  170. data/lib/locales/ja/ancient.yml +4 -0
  171. data/lib/locales/ja/bank.yml +4 -0
  172. data/lib/locales/ja/book.yml +7 -0
  173. data/lib/locales/ja/coffee.yml +4 -0
  174. data/lib/locales/ja/color.yml +4 -0
  175. data/lib/locales/ja/commerce.yml +11 -0
  176. data/lib/locales/ja/company.yml +8 -0
  177. data/lib/locales/ja/creature.yml +9 -0
  178. data/lib/locales/ja/food.yml +4 -0
  179. data/lib/locales/ja/games.yml +18 -0
  180. data/lib/locales/ja/gender.yml +4 -0
  181. data/lib/locales/ja/lorem.yml +9 -0
  182. data/lib/locales/ja/name.yml +13 -0
  183. data/lib/locales/ja/phone_number.yml +7 -0
  184. data/lib/locales/ja/restaurant.yml +11 -0
  185. data/lib/locales/ja/space.yml +5 -0
  186. data/lib/locales/ja/subscription.yml +8 -0
  187. data/lib/locales/ja/university.yml +9 -0
  188. data/lib/locales/pt-BR.yml +2 -1
  189. data/lib/locales/ru.yml +39 -0
  190. data/lib/locales/uk.yml +2 -0
  191. metadata +92 -19
  192. data/lib/locales/en/hobbit.yml +0 -19
  193. data/lib/locales/en/lord_of_the_rings.yml +0 -6
  194. data/lib/locales/ja.yml +0 -101
@@ -54,7 +54,7 @@ module Faker
54
54
  keywords << :include_secondary if legacy_include_secondary != NOT_GIVEN
55
55
  end
56
56
 
57
- numerify(parse('address.street_address') + (include_secondary ? ' ' + secondary_address : ''))
57
+ numerify(parse('address.street_address') + (include_secondary ? " #{secondary_address}" : ''))
58
58
  end
59
59
 
60
60
  ##
@@ -133,7 +133,7 @@ module Faker
133
133
 
134
134
  # provide a zip code that is valid for the state provided
135
135
  # see http://www.fincen.gov/forms/files/us_state_territory_zip_codes.pdf
136
- bothify(fetch('address.postcode_by_state.' + state_abbreviation))
136
+ bothify(fetch("address.postcode_by_state.#{state_abbreviation}"))
137
137
  end
138
138
 
139
139
  ##
@@ -247,7 +247,7 @@ module Faker
247
247
  keywords << :code if legacy_code != NOT_GIVEN
248
248
  end
249
249
 
250
- fetch('address.country_by_code.' + code)
250
+ fetch("address.country_by_code.#{code}")
251
251
  end
252
252
 
253
253
  ##
@@ -265,7 +265,7 @@ module Faker
265
265
  keywords << :name if legacy_name != NOT_GIVEN
266
266
  end
267
267
 
268
- fetch('address.country_by_name.' + name)
268
+ fetch("address.country_by_name.#{name}")
269
269
  end
270
270
 
271
271
  ##
@@ -63,7 +63,6 @@ module Faker
63
63
  #
64
64
  # @faker.version 1.4.3
65
65
  def semantic_version(legacy_major = NOT_GIVEN, legacy_minor = NOT_GIVEN, legacy_patch = NOT_GIVEN, major: 0..9, minor: 0..9, patch: 1..9)
66
- # rubocop:enable Metrics/ParameterLists
67
66
  warn_for_deprecated_arguments do |keywords|
68
67
  keywords << :major if legacy_major != NOT_GIVEN
69
68
  keywords << :minor if legacy_minor != NOT_GIVEN
@@ -72,6 +71,7 @@ module Faker
72
71
 
73
72
  [major, minor, patch].map { |chunk| sample(Array(chunk)) }.join('.')
74
73
  end
74
+ # rubocop:enable Metrics/ParameterLists
75
75
  end
76
76
  end
77
77
  end
@@ -39,7 +39,6 @@ module Faker
39
39
  #
40
40
  # @faker.version 1.4.3
41
41
  def image(legacy_slug = NOT_GIVEN, legacy_size = NOT_GIVEN, legacy_format = NOT_GIVEN, legacy_set = NOT_GIVEN, legacy_bgset = NOT_GIVEN, slug: nil, size: '300x300', format: 'png', set: 'set1', bgset: nil)
42
- # rubocop:enable Metrics/ParameterLists
43
42
  warn_for_deprecated_arguments do |keywords|
44
43
  keywords << :slug if legacy_slug != NOT_GIVEN
45
44
  keywords << :size if legacy_size != NOT_GIVEN
@@ -55,6 +54,7 @@ module Faker
55
54
  bgset_query = "&bgset=#{bgset}" if bgset
56
55
  "https://robohash.org/#{slug}.#{format}?size=#{size}&set=#{set}#{bgset_query}"
57
56
  end
57
+ # rubocop:enable Metrics/ParameterLists
58
58
  end
59
59
  end
60
60
  end
@@ -31,12 +31,13 @@ module Faker
31
31
  ##
32
32
  # Produces a bank iban number.
33
33
  #
34
- # @param country_code [String] Specifies what country prefix is used to generate the iban code.
34
+ # @param country_code [String, nil] Specifies what country prefix is used to generate the iban code. Providing `nil` will use a random country.
35
35
  # @return [String]
36
36
  #
37
37
  # @example
38
38
  # Faker::Bank.iban #=> "GB76DZJM33188515981979"
39
39
  # Faker::Bank.iban(country_code: "be") #=> "BE6375388567752043"
40
+ # Faker::Bank.iban(country_code: nil) #=> "DE45186738071857270067"
40
41
  #
41
42
  # @faker.version 1.7.0
42
43
  def iban(legacy_country_code = NOT_GIVEN, country_code: 'GB')
@@ -47,6 +48,8 @@ module Faker
47
48
  keywords << :country_code if legacy_country_code != NOT_GIVEN
48
49
  end
49
50
 
51
+ country_code ||= iban_country_code
52
+
50
53
  begin
51
54
  pattern = fetch("bank.iban_details.#{country_code.downcase}.bban_pattern")
52
55
  rescue I18n::MissingTranslationData
@@ -60,6 +63,19 @@ module Faker
60
63
  country_code.upcase + iban_checksum(country_code, account) + account
61
64
  end
62
65
 
66
+ ##
67
+ # Produces the ISO 3166 code of a country that uses the IBAN system.
68
+ #
69
+ # @return [String]
70
+ #
71
+ # @example
72
+ # Faker::Bank.iban_country_code #=> "CH"
73
+ #
74
+ # @faker.version next
75
+ def iban_country_code
76
+ sample(translate('faker.bank.iban_details').keys).to_s.upcase
77
+ end
78
+
63
79
  ##
64
80
  # Produces a bank name.
65
81
  #
@@ -140,15 +156,13 @@ module Faker
140
156
  def compile_routing_number
141
157
  digit_one_two = %w[00 01 02 03 04 05 06 07 08 09 10 11 12]
142
158
  ((21..32).to_a + (61..72).to_a + [80]).each { |x| digit_one_two << x.to_s }
143
- routing_num = digit_one_two.sample + rand_numstring + rand_numstring + rand_numstring + rand_numstring + rand_numstring + rand_numstring + rand_numstring
144
- routing_num
159
+ digit_one_two.sample + rand_numstring + rand_numstring + rand_numstring + rand_numstring + rand_numstring + rand_numstring + rand_numstring
145
160
  end
146
161
 
147
162
  def compile_bsb_number
148
163
  digit_one_two = %w[01 03 06 08 11 12 73 76 78 30]
149
164
  state = (2..7).to_a.map(&:to_s).sample
150
- bsb_num = digit_one_two.sample + state + rand_numstring + rand_numstring + rand_numstring
151
- bsb_num
165
+ digit_one_two.sample + state + rand_numstring + rand_numstring + rand_numstring
152
166
  end
153
167
 
154
168
  # Calculates the mandatory checksum in 3rd and 4th characters in IBAN format
@@ -182,7 +196,7 @@ module Faker
182
196
  prefix = (1..50).to_a.map(&:to_s).sample
183
197
  numerator = routing_num.split('')[5..8].join.to_i.to_s
184
198
  denominator = routing_num.split('')[0..4].join.to_i.to_s
185
- prefix + '-' + numerator + '/' + denominator
199
+ "#{prefix}-#{numerator}/#{denominator}"
186
200
  end
187
201
 
188
202
  def rand_numstring
@@ -3,105 +3,114 @@
3
3
  module Faker
4
4
  class Barcode < Base
5
5
  class << self
6
- ## Returns a EAN 8 or 13 digit format barcode number with check digit
7
- # @returns [String]
6
+ ##
7
+ # Returns a EAN 8 or 13 digit format barcode number with check digit
8
+ # @return [String]
8
9
  #
9
10
  # @example
10
11
  # Faker::Barcode.ean => "85657526"
11
12
  # Faker::Barcode.ean(8) => "30152700"
12
13
  # Faker::Barcode.ean(13) => "2115190480285"
13
14
  #
14
- # @faker.version next
15
+ # @faker.version 2.14.0
15
16
  def ean(length = 8)
16
17
  generate_barcode("barcode.ean_#{Integer(length)}")
17
18
  end
18
19
 
19
- ## Returns a EAN 8 or 13 digit format barcode number with composite string attached with check digit
20
- # @returns [String]
20
+ ##
21
+ # Returns a EAN 8 or 13 digit format barcode number with composite string attached with check digit
22
+ # @return [String]
21
23
  #
22
24
  # @example
23
25
  # Faker::Barcode.ean_with_composite_sumbology => "41007624|JHOC6649"
24
26
  # Faker::Barcode.ean_with_composite_sumbology(8) => "38357961|XUYJ3266"
25
27
  # Faker::Barcode.ean_with_composite_sumbology(13) => "9530722443911|CKHWQHID"
26
28
  #
27
- # @faker.version next
29
+ # @faker.version 2.14.0
28
30
  def ean_with_composite_symbology(length = 8)
29
31
  "#{ean(length)}|#{bothify(parse('barcode.composite_symbol'))}"
30
32
  end
31
33
 
32
- ## Returns a UPC_A format barcode number with check digit
33
- # @returns [String]
34
+ ##
35
+ # Returns a UPC_A format barcode number with check digit
36
+ # @return [String]
34
37
  #
35
38
  # @example
36
39
  # Faker::Barcode.upc_a => "766807541831"
37
40
  #
38
- # @faker.version next
41
+ # @faker.version 2.14.0
39
42
  def upc_a
40
43
  generate_barcode('barcode.upc_a')
41
44
  end
42
45
 
43
- ## Returns a UPC_E format barcode number with check digit
44
- # @returns [String]
46
+ ##
47
+ # Returns a UPC_E format barcode number with check digit
48
+ # @return [String]
45
49
  #
46
50
  # @example
47
51
  # Faker::Barcode.upc_e => "03746820"
48
52
  #
49
- # @faker.version next
53
+ # @faker.version 2.14.0
50
54
  def upc_e
51
55
  generate_barcode('barcode.upc_e')
52
56
  end
53
57
 
54
- ## Returns a UPC_A format barcode number with composite string attached with check digit
55
- # @returns [String]
58
+ ##
59
+ # Returns a UPC_A format barcode number with composite string attached with check digit
60
+ # @return [String]
56
61
  #
57
62
  # @example
58
63
  # Faker::Barcode.upc_a_with_composite_symbology => "790670155765|JOVG6208"
59
64
  #
60
- # @faker.version next
65
+ # @faker.version 2.14.0
61
66
  def upc_a_with_composite_symbology
62
67
  "#{upc_a}|#{bothify(parse('barcode.composite_symbol'))}"
63
68
  end
64
69
 
65
- ## Returns a UPC_E format barcode number with composite string attached with check digit
66
- # @returns [String]
70
+ ##
71
+ # Returns a UPC_E format barcode number with composite string attached with check digit
72
+ # @return [String]
67
73
  #
68
74
  # @example
69
75
  # Faker::Barcode.upc_e_with_composite_symbology => "05149247|BKZX9722"
70
76
  #
71
- # @faker.version next
77
+ # @faker.version 2.14.0
72
78
  def upc_e_with_composite_symbology
73
79
  "#{upc_e}|#{bothify(parse('barcode.composite_symbol'))}"
74
80
  end
75
81
 
76
- ## Returns a ISBN format barcode number with check digit
77
- # @returns [String]
82
+ ##
83
+ # Returns a ISBN format barcode number with check digit
84
+ # @return [String]
78
85
  #
79
86
  # @example
80
87
  # Faker::Barcode.isbn => "9798363807732"
81
88
  #
82
- # @faker.version next
89
+ # @faker.version 2.14.0
83
90
  def isbn
84
91
  generate_barcode('barcode.isbn')
85
92
  end
86
93
 
87
- ## Returns a ISMN format barcode number with check digit
88
- # @returns [String]
94
+ ##
95
+ # Returns a ISMN format barcode number with check digit
96
+ # @return [String]
89
97
  #
90
98
  # @example
91
99
  # Faker::Barcode.ismn => "9790527672897"
92
100
  #
93
- # @faker.version next
101
+ # @faker.version 2.14.0
94
102
  def ismn
95
103
  generate_barcode('barcode.ismn')
96
104
  end
97
105
 
98
- ## Returns a ISSN format barcode number with check digit
99
- # @returns [String]
106
+ ##
107
+ # Returns a ISSN format barcode number with check digit
108
+ # @return [String]
100
109
  #
101
110
  # @example
102
111
  # Faker::Barcode.issn => "9775541703338"
103
112
  #
104
- # @faker.version next
113
+ # @faker.version 2.14.0
105
114
  def issn
106
115
  generate_barcode('barcode.issn')
107
116
  end
@@ -114,15 +123,16 @@ module Faker
114
123
  "#{barcode}#{check_digit}"
115
124
  end
116
125
 
117
- ## Returns the sum of even and odd numbers from value passed
126
+ ##
127
+ # Returns the sum of even and odd numbers from value passed
118
128
  #
119
- # @returns [Array]
129
+ # @return [Array]
120
130
  #
121
131
  # @example
122
132
  # Faker::Barcode.send(:sum_even_odd, 12345) => [9, 5]
123
133
  # Faker::Barcode.send(:sum_even_odd, 87465) => [17, 13]
124
134
  #
125
- # @faker.version next
135
+ # @faker.version 2.14.0
126
136
  def sum_even_odd(fake_num)
127
137
  number = fake_num.to_i
128
138
  sum_even, sum_odd = 0, 0, index = 1
@@ -137,15 +147,16 @@ module Faker
137
147
  [sum_odd, sum_even]
138
148
  end
139
149
 
140
- ## Generates the check digits from sum passed
150
+ ##
151
+ # Generates the check digits from sum passed
141
152
  #
142
- # @returns [Integer]
153
+ # @return [Integer]
143
154
  #
144
155
  # @example
145
156
  # Faker::Barcode.send(:generate_check_digit, 12, 4) => 0
146
157
  # Faker::Barcode.send(:generate_check_digit, 23, 5) => 6
147
158
  #
148
- # @faker.version next
159
+ # @faker.version 2.14.0
149
160
  def generate_check_digit(odd_sum, even_sum)
150
161
  (10 - (odd_sum * 3 + even_sum) % 10) % 10
151
162
  end
@@ -80,7 +80,7 @@ module Faker
80
80
  #
81
81
  # @faker.version 1.6.2
82
82
  def ibu
83
- rand(10..100).to_s + ' IBU'
83
+ "#{rand(10..100)} IBU"
84
84
  end
85
85
 
86
86
  ##
@@ -93,7 +93,7 @@ module Faker
93
93
  #
94
94
  # @faker.version 1.6.2
95
95
  def alcohol
96
- rand(2.0..10.0).round(1).to_s + '%'
96
+ "#{rand(2.0..10.0).round(1)}%"
97
97
  end
98
98
 
99
99
  ##
@@ -106,7 +106,7 @@ module Faker
106
106
  #
107
107
  # @faker.version 1.6.2
108
108
  def blg
109
- rand(5.0..20.0).round(1).to_s + '°Blg'
109
+ "#{rand(5.0..20.0).round(1)}°Blg"
110
110
  end
111
111
  end
112
112
  end
@@ -0,0 +1,46 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Faker
4
+ class Camera < Base
5
+ class << self
6
+ ##
7
+ # Produces a brand of a camera
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::Camera.brand #=> "Canon"
13
+ #
14
+ # @faker.version next
15
+ def brand
16
+ fetch('camera.brand')
17
+ end
18
+
19
+ ##
20
+ # Produces a model of camera
21
+ #
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::Camera.model #=> "450D"
26
+ #
27
+ # @faker.version next
28
+ def model
29
+ fetch('camera.model')
30
+ end
31
+
32
+ ##
33
+ # Produces a brand with model
34
+ #
35
+ # @return [String]
36
+ #
37
+ # @example
38
+ # Faker::Camera.brand_with_model #=> "Canon 450D"
39
+ #
40
+ # @faker.version next
41
+ def brand_with_model
42
+ fetch('camera.brand_with_model')
43
+ end
44
+ end
45
+ end
46
+ end
@@ -2,6 +2,7 @@
2
2
 
3
3
  module Faker
4
4
  class Cannabis < Base
5
+ ##
5
6
  # Produces a random strain.
6
7
  #
7
8
  # @return [String]
@@ -14,6 +15,7 @@ module Faker
14
15
  fetch('cannabis.strains')
15
16
  end
16
17
 
18
+ ##
17
19
  # Produces a random abbreviation.
18
20
  #
19
21
  # @return [String]
@@ -26,6 +28,7 @@ module Faker
26
28
  fetch('cannabis.cannabinoid_abbreviations')
27
29
  end
28
30
 
31
+ ##
29
32
  # Produces a random cannabinoid type.
30
33
  #
31
34
  # @return [String]
@@ -38,6 +41,7 @@ module Faker
38
41
  fetch('cannabis.cannabinoids')
39
42
  end
40
43
 
44
+ ##
41
45
  # Produces a random terpene type.
42
46
  #
43
47
  # @return [String]
@@ -50,6 +54,7 @@ module Faker
50
54
  fetch('cannabis.terpenes')
51
55
  end
52
56
 
57
+ ##
53
58
  # Produces a random kind of medical use.
54
59
  #
55
60
  # @return [String]
@@ -62,6 +67,7 @@ module Faker
62
67
  fetch('cannabis.medical_uses')
63
68
  end
64
69
 
70
+ ##
65
71
  # Produces a random health benefit.
66
72
  #
67
73
  # @return [String]
@@ -74,6 +80,7 @@ module Faker
74
80
  fetch('cannabis.health_benefits')
75
81
  end
76
82
 
83
+ ##
77
84
  # Produces a random category.
78
85
  #
79
86
  # @return [String]
@@ -86,6 +93,7 @@ module Faker
86
93
  fetch('cannabis.categories')
87
94
  end
88
95
 
96
+ ##
89
97
  # Produces a random type.
90
98
  #
91
99
  # @return [String]
@@ -98,6 +106,7 @@ module Faker
98
106
  fetch('cannabis.types')
99
107
  end
100
108
 
109
+ ##
101
110
  # Produces a random buzzword.
102
111
  #
103
112
  # @return [String]
@@ -110,6 +119,7 @@ module Faker
110
119
  fetch('cannabis.buzzwords')
111
120
  end
112
121
 
122
+ ##
113
123
  # Produces a random brand.
114
124
  #
115
125
  # @return [String]