faker 1.9.6 → 2.7.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (173) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +386 -6
  3. data/README.md +12 -5
  4. data/lib/faker.rb +56 -1
  5. data/lib/faker/blockchain/aeternity.rb +70 -0
  6. data/lib/faker/blockchain/bitcoin.rb +26 -0
  7. data/lib/faker/blockchain/ethereum.rb +10 -0
  8. data/lib/faker/blockchain/tezos.rb +62 -6
  9. data/lib/faker/books/book.rb +36 -0
  10. data/lib/faker/books/culture_series.rb +49 -0
  11. data/lib/faker/books/dune.rb +66 -5
  12. data/lib/faker/books/lovecraft.rb +221 -18
  13. data/lib/faker/creature/animal.rb +10 -1
  14. data/lib/faker/creature/cat.rb +28 -1
  15. data/lib/faker/creature/dog.rb +73 -1
  16. data/lib/faker/creature/horse.rb +19 -1
  17. data/lib/faker/default/address.rb +25 -5
  18. data/lib/faker/default/alphanumeric.rb +58 -9
  19. data/lib/faker/default/app.rb +55 -1
  20. data/lib/faker/default/appliance.rb +18 -0
  21. data/lib/faker/default/artist.rb +9 -0
  22. data/lib/faker/default/avatar.rb +43 -1
  23. data/lib/faker/default/bank.rb +10 -2
  24. data/lib/faker/default/boolean.rb +16 -1
  25. data/lib/faker/default/cannabis.rb +4 -0
  26. data/lib/faker/default/chile_rut.rb +13 -3
  27. data/lib/faker/default/chuck_norris.rb +1 -1
  28. data/lib/faker/default/code.rb +18 -5
  29. data/lib/faker/default/commerce.rb +18 -4
  30. data/lib/faker/default/company.rb +11 -3
  31. data/lib/faker/default/crypto_coin.rb +21 -4
  32. data/lib/faker/default/date.rb +122 -9
  33. data/lib/faker/default/demographic.rb +5 -1
  34. data/lib/faker/default/dessert.rb +27 -0
  35. data/lib/faker/default/device.rb +56 -2
  36. data/lib/faker/default/driving_licence.rb +13 -7
  37. data/lib/faker/default/educator.rb +0 -3
  38. data/lib/faker/default/electrical_components.rb +27 -0
  39. data/lib/faker/default/file.rb +20 -3
  40. data/lib/faker/default/fillmurray.rb +10 -2
  41. data/lib/faker/default/finance.rb +5 -1
  42. data/lib/faker/default/gender.rb +18 -0
  43. data/lib/faker/default/greek_philosophers.rb +18 -0
  44. data/lib/faker/default/hacker.rb +59 -1
  45. data/lib/faker/default/hipster.rb +55 -16
  46. data/lib/faker/default/house.rb +18 -0
  47. data/lib/faker/default/id_number.rb +85 -11
  48. data/lib/faker/default/industry_segments.rb +36 -0
  49. data/lib/faker/default/internet.rb +107 -22
  50. data/lib/faker/default/invoice.rb +16 -3
  51. data/lib/faker/default/json.rb +19 -2
  52. data/lib/faker/default/lorem.rb +91 -20
  53. data/lib/faker/default/lorem_flickr.rb +38 -5
  54. data/lib/faker/default/lorem_pixel.rb +10 -1
  55. data/lib/faker/default/markdown.rb +12 -7
  56. data/lib/faker/default/marketing.rb +9 -0
  57. data/lib/faker/default/measurement.rb +40 -8
  58. data/lib/faker/default/military.rb +45 -0
  59. data/lib/faker/default/name.rb +6 -4
  60. data/lib/faker/default/nation.rb +48 -5
  61. data/lib/faker/default/nato_phonetic_alphabet.rb +9 -0
  62. data/lib/faker/default/nhs.rb +11 -7
  63. data/lib/faker/default/number.rb +202 -30
  64. data/lib/faker/default/omniauth.rb +98 -15
  65. data/lib/faker/default/phone_number.rb +5 -1
  66. data/lib/faker/default/placeholdit.rb +11 -1
  67. data/lib/faker/default/programming_language.rb +18 -0
  68. data/lib/faker/default/relationship.rb +5 -1
  69. data/lib/faker/default/restaurant.rb +54 -2
  70. data/lib/faker/default/science.rb +27 -0
  71. data/lib/faker/default/source.rb +59 -3
  72. data/lib/faker/default/south_africa.rb +1 -1
  73. data/lib/faker/default/space.rb +2 -2
  74. data/lib/faker/default/string.rb +5 -1
  75. data/lib/faker/default/stripe.rb +20 -4
  76. data/lib/faker/default/subscription.rb +45 -0
  77. data/lib/faker/default/superhero.rb +45 -0
  78. data/lib/faker/default/time.rb +133 -8
  79. data/lib/faker/default/twitter.rb +62 -48
  80. data/lib/faker/default/types.rb +29 -7
  81. data/lib/faker/default/vehicle.rb +19 -6
  82. data/lib/faker/default/world_cup.rb +61 -2
  83. data/lib/faker/games/dota.rb +53 -2
  84. data/lib/faker/games/elder_scrolls.rb +73 -1
  85. data/lib/faker/games/fallout.rb +38 -1
  86. data/lib/faker/games/game.rb +27 -0
  87. data/lib/faker/games/half_life.rb +28 -1
  88. data/lib/faker/games/heroes.rb +28 -1
  89. data/lib/faker/games/heroes_of_the_storm.rb +37 -1
  90. data/lib/faker/games/league_of_legends.rb +55 -1
  91. data/lib/faker/games/myst.rb +46 -1
  92. data/lib/faker/games/overwatch.rb +28 -1
  93. data/lib/faker/games/pokemon.rb +28 -1
  94. data/lib/faker/games/sonic_the_hedgehog.rb +28 -1
  95. data/lib/faker/games/super_smash_bros.rb +19 -1
  96. data/lib/faker/games/witcher.rb +55 -1
  97. data/lib/faker/games/world_of_warcraft.rb +19 -1
  98. data/lib/faker/games/zelda.rb +38 -2
  99. data/lib/faker/japanese_media/dragon_ball.rb +10 -1
  100. data/lib/faker/japanese_media/one_piece.rb +55 -1
  101. data/lib/faker/japanese_media/sword_art_online.rb +37 -1
  102. data/lib/faker/movies/back_to_the_future.rb +29 -1
  103. data/lib/faker/movies/ghostbusters.rb +29 -1
  104. data/lib/faker/movies/harry_potter.rb +55 -1
  105. data/lib/faker/movies/hitchhikers_guide_to_the_galaxy.rb +70 -1
  106. data/lib/faker/movies/hobbit.rb +38 -1
  107. data/lib/faker/movies/lebowski.rb +28 -1
  108. data/lib/faker/movies/lord_of_the_rings.rb +29 -1
  109. data/lib/faker/movies/movie.rb +9 -0
  110. data/lib/faker/movies/princess_bride.rb +20 -1
  111. data/lib/faker/movies/star_wars.rb +101 -5
  112. data/lib/faker/movies/v_for_vendetta.rb +30 -1
  113. data/lib/faker/music/grateful_dead.rb +18 -0
  114. data/lib/faker/music/phish.rb +9 -0
  115. data/lib/faker/music/rock_band.rb +9 -0
  116. data/lib/faker/music/umphreys_mcgee.rb +9 -0
  117. data/lib/faker/sports/basketball.rb +36 -0
  118. data/lib/faker/sports/football.rb +45 -0
  119. data/lib/faker/tv_shows/aqua_teen_hunger_force.rb +10 -1
  120. data/lib/faker/tv_shows/bojack_horseman.rb +29 -1
  121. data/lib/faker/tv_shows/breaking_bad.rb +19 -1
  122. data/lib/faker/tv_shows/buffy.rb +46 -1
  123. data/lib/faker/tv_shows/community.rb +20 -1
  124. data/lib/faker/tv_shows/dr_who.rb +79 -3
  125. data/lib/faker/tv_shows/dumb_and_dumber.rb +29 -1
  126. data/lib/faker/tv_shows/family_guy.rb +29 -1
  127. data/lib/faker/tv_shows/friends.rb +28 -1
  128. data/lib/faker/tv_shows/game_of_thrones.rb +47 -1
  129. data/lib/faker/tv_shows/hey_arnold.rb +28 -1
  130. data/lib/faker/tv_shows/how_i_met_your_mother.rb +38 -1
  131. data/lib/faker/tv_shows/michael_scott.rb +14 -1
  132. data/lib/faker/tv_shows/new_girl.rb +20 -1
  133. data/lib/faker/tv_shows/parks_and_rec.rb +19 -1
  134. data/lib/faker/tv_shows/rick_and_morty.rb +29 -1
  135. data/lib/faker/tv_shows/ru_paul.rb +19 -1
  136. data/lib/faker/tv_shows/seinfeld.rb +29 -1
  137. data/lib/faker/tv_shows/silicon_valley.rb +76 -1
  138. data/lib/faker/tv_shows/simpsons.rb +29 -1
  139. data/lib/faker/tv_shows/south_park.rb +20 -1
  140. data/lib/faker/tv_shows/star_trek.rb +37 -1
  141. data/lib/faker/tv_shows/stargate.rb +29 -1
  142. data/lib/faker/tv_shows/stranger_things.rb +20 -1
  143. data/lib/faker/tv_shows/the_expanse.rb +37 -1
  144. data/lib/faker/tv_shows/the_fresh_prince_of_bel_air.rb +29 -1
  145. data/lib/faker/tv_shows/the_it_crowd.rb +38 -1
  146. data/lib/faker/tv_shows/the_thick_of_it.rb +29 -1
  147. data/lib/faker/tv_shows/twin_peaks.rb +29 -1
  148. data/lib/faker/tv_shows/venture_bros.rb +39 -1
  149. data/lib/faker/version.rb +1 -1
  150. data/lib/locales/en-CA.yml +2 -1
  151. data/lib/locales/en-IND.yml +1 -1
  152. data/lib/locales/en-TH.yml +360 -0
  153. data/lib/locales/en.yml +4 -1
  154. data/lib/locales/en/address.yml +1 -4
  155. data/lib/locales/en/animal.yml +2 -2
  156. data/lib/locales/en/cannabis.yml +1 -0
  157. data/lib/locales/en/color.yml +1 -1
  158. data/lib/locales/en/dr_who.yml +1 -1
  159. data/lib/locales/en/science.yml +1 -1
  160. data/lib/locales/en/space.yml +1 -1
  161. data/lib/locales/en/super_smash_bros.yml +5 -0
  162. data/lib/locales/fr-CA.yml +1 -1
  163. data/lib/locales/ja.yml +12 -9
  164. data/lib/locales/th.yml +380 -0
  165. data/lib/locales/vi.yml +1 -1
  166. metadata +44 -27
  167. data/lib/faker/default/creature.rb +0 -6
  168. data/lib/faker/default/games.rb +0 -6
  169. data/lib/faker/default/japanese_media.rb +0 -6
  170. data/lib/faker/default/movies.rb +0 -6
  171. data/lib/faker/default/tv_shows.rb +0 -6
  172. data/lib/faker/deprecate/unreleased/football.rb +0 -35
  173. data/lib/faker/deprecate/unreleased/movies/grateful_dead.rb +0 -22
@@ -40,7 +40,11 @@ module Faker
40
40
  # US and Canada only
41
41
  # Can be used for both extensions and last four digits of phone number.
42
42
  # Since extensions can be of variable length, this method taks a length parameter
43
- def subscriber_number(length = 4)
43
+ def subscriber_number(legacy_length = NOT_GIVEN, length: 4)
44
+ warn_for_deprecated_arguments do |keywords|
45
+ keywords << :length if legacy_length != NOT_GIVEN
46
+ end
47
+
44
48
  rand.to_s[2..(1 + length)]
45
49
  end
46
50
 
@@ -5,7 +5,17 @@ module Faker
5
5
  class << self
6
6
  SUPPORTED_FORMATS = %w[png jpg gif jpeg].freeze
7
7
 
8
- def image(size = '300x300', format = 'png', background_color = nil, text_color = nil, text = nil)
8
+ # rubocop:disable Metrics/ParameterLists
9
+ def image(legacy_size = NOT_GIVEN, legacy_format = NOT_GIVEN, legacy_background_color = NOT_GIVEN, legacy_text_color = NOT_GIVEN, legacy_text = NOT_GIVEN, size: '300x300', format: 'png', background_color: nil, text_color: nil, text: nil)
10
+ # rubocop:enable Metrics/ParameterLists
11
+ warn_for_deprecated_arguments do |keywords|
12
+ keywords << :size if legacy_size != NOT_GIVEN
13
+ keywords << :format if legacy_format != NOT_GIVEN
14
+ keywords << :background_color if legacy_background_color != NOT_GIVEN
15
+ keywords << :text_color if legacy_text_color != NOT_GIVEN
16
+ keywords << :text if legacy_text != NOT_GIVEN
17
+ end
18
+
9
19
  background_color = generate_color if background_color == :random
10
20
  text_color = generate_color if text_color == :random
11
21
 
@@ -3,10 +3,28 @@
3
3
  module Faker
4
4
  class ProgrammingLanguage < Base
5
5
  class << self
6
+ ##
7
+ # Produces the name of a programming language.
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::ProgrammingLanguage.name #=> "Ruby"
13
+ #
14
+ # @faker.version 1.8.5
6
15
  def name
7
16
  fetch('programming_language.name')
8
17
  end
9
18
 
19
+ ##
20
+ # Produces the name of a programming language's creator.
21
+ #
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::ProgrammingLanguage.creator #=> "Yukihiro Matsumoto"
26
+ #
27
+ # @faker.version 1.8.5
10
28
  def creator
11
29
  fetch('programming_language.creator')
12
30
  end
@@ -5,7 +5,11 @@ module Faker
5
5
  flexible :relationship
6
6
 
7
7
  class << self
8
- def familial(connection = nil)
8
+ def familial(legacy_connection = NOT_GIVEN, connection: nil)
9
+ warn_for_deprecated_arguments do |keywords|
10
+ keywords << :connection if legacy_connection != NOT_GIVEN
11
+ end
12
+
9
13
  familial_connections = translate('faker.relationship.familial').keys
10
14
 
11
15
  if connection.nil?
@@ -4,8 +4,60 @@ module Faker
4
4
  class Restaurant < Base
5
5
  flexible :restaurant
6
6
 
7
- def self.name
8
- bothify(parse('restaurant.name'))
7
+ class << self
8
+ ##
9
+ # Produces the name of a restaurant.
10
+ #
11
+ # @return [String]
12
+ #
13
+ # @example
14
+ # Faker::Restaurant.name #=> "Curry King"
15
+ #
16
+ # @faker.version 1.9.2
17
+ def name
18
+ bothify(parse('restaurant.name'))
19
+ end
20
+
21
+ ##
22
+ # Produces a type of restaurant.
23
+ #
24
+ # @return [String]
25
+ #
26
+ # @example
27
+ # Faker::Restaurant.type #=> "Comfort Food"
28
+ #
29
+ # @faker.version 1.9.2
30
+ def type
31
+ fetch('restaurant.type')
32
+ end
33
+
34
+ ##
35
+ # Produces a description of a restaurant.
36
+ #
37
+ # @return [String]
38
+ #
39
+ # @example
40
+ # Faker::Restaurant.description
41
+ # #=> "We are committed to using the finest ingredients in our recipes. No food leaves our kitchen that we ourselves would not eat."
42
+ #
43
+ # @faker.version 1.9.2
44
+ def description
45
+ fetch('restaurant.description')
46
+ end
47
+
48
+ ##
49
+ # Produces a review for a restaurant.
50
+ #
51
+ # @return [String]
52
+ #
53
+ # @example
54
+ # Faker::Restaurant.review
55
+ # #=> "Brand new. Great design. Odd to hear pop music in a Mexican establishment. Music is a bit loud. It should be background."
56
+ #
57
+ # @faker.version 1.9.2
58
+ def review
59
+ fetch('restaurant.review')
60
+ end
9
61
  end
10
62
  end
11
63
  end
@@ -3,14 +3,41 @@
3
3
  module Faker
4
4
  class Science < Base
5
5
  class << self
6
+ ##
7
+ # Produces the name of a element.
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::Science.element #=> "Carbon"
13
+ #
14
+ # @faker.version 1.8.5
6
15
  def element
7
16
  fetch('science.element')
8
17
  end
9
18
 
19
+ ##
20
+ # Produces the symbol of an element.
21
+ #
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::Science.element_symbol #=> "Pb"
26
+ #
27
+ # @faker.version 1.9.0
10
28
  def element_symbol
11
29
  fetch('science.element_symbol')
12
30
  end
13
31
 
32
+ ##
33
+ # Produces the name of a scientist.
34
+ #
35
+ # @return [String]
36
+ #
37
+ # @example
38
+ # Faker::Science.scientist #=> "Isaac Newton"
39
+ #
40
+ # @faker.version 1.8.5
14
41
  def scientist
15
42
  fetch('science.scientist')
16
43
  end
@@ -3,16 +3,72 @@
3
3
  module Faker
4
4
  class Source < Base
5
5
  class << self
6
- def hello_world(lang = :ruby)
6
+ ##
7
+ # Produces source code for Hello World in a given language.
8
+ #
9
+ # @param lang [Symbol] The programming language to use
10
+ # @return [String]
11
+ #
12
+ # @example
13
+ # Faker::Source.hello_world #=> "puts 'Hello World!'"
14
+ #
15
+ # @example
16
+ # Faker::Source.hello_world(lang: :javascript)
17
+ # #=> "alert('Hello World!');"
18
+ #
19
+ # @faker.version 1.9.0
20
+ def hello_world(legacy_lang = NOT_GIVEN, lang: :ruby)
21
+ warn_for_deprecated_arguments do |keywords|
22
+ keywords << :lang if legacy_lang != NOT_GIVEN
23
+ end
24
+
7
25
  fetch("source.hello_world.#{lang}")
8
26
  end
9
27
 
10
- def print(str: 'some string', lang: :ruby)
28
+ ##
29
+ # Produces source code for printing a string in a given language.
30
+ #
31
+ # @param str [String] The string to print
32
+ # @param lang [Symbol] The programming language to use
33
+ # @return [String]
34
+ #
35
+ # @example
36
+ # Faker::Source.print #=> "puts 'faker_string_to_print'"
37
+ # @example
38
+ # Faker::Source.print(str: 'foo bar', lang: :javascript)
39
+ # #=> "console.log('foo bar');"
40
+ #
41
+ # @faker.version 1.9.0
42
+ def print(legacy_str = NOT_GIVEN, legacy_lang = NOT_GIVEN, str: 'some string', lang: :ruby)
43
+ warn_for_deprecated_arguments do |keywords|
44
+ keywords << :str if legacy_str != NOT_GIVEN
45
+ end
46
+ warn_for_deprecated_arguments do |keywords|
47
+ keywords << :lang if legacy_lang != NOT_GIVEN
48
+ end
11
49
  code = fetch("source.print.#{lang}")
12
50
  code.gsub('faker_string_to_print', str)
13
51
  end
14
52
 
15
- def print_1_to_10(lang = :ruby)
53
+ ##
54
+ # Produces source code for printing 1 through 10 in a given language.
55
+ #
56
+ # @param lang [Symbol] The programming language to use
57
+ # @return [String]
58
+ #
59
+ # @example
60
+ # Faker::Source.print_1_to_10 #=> "(1..10).each { |i| puts i }"
61
+ # @example
62
+ # Faker::Source.print_1_to_10(lang: :javascript)
63
+ # # => "for (let i=0; i<10; i++) {
64
+ # # console.log(i);
65
+ # # }"
66
+ #
67
+ # @faker.version 1.9.0
68
+ def print_1_to_10(legacy_lang = NOT_GIVEN, lang: :ruby)
69
+ warn_for_deprecated_arguments do |keywords|
70
+ keywords << :lang if legacy_lang != NOT_GIVEN
71
+ end
16
72
  fetch("source.print_1_to_10.#{lang}")
17
73
  end
18
74
  end
@@ -44,7 +44,7 @@ module Faker
44
44
  end
45
45
 
46
46
  def vat_number
47
- Faker::Finance.vat_number('ZA')
47
+ Faker::Finance.vat_number(country: 'ZA')
48
48
  end
49
49
  end
50
50
  end
@@ -56,8 +56,8 @@ module Faker
56
56
  fetch('space.meteorite')
57
57
  end
58
58
 
59
- def launch_vehicule
60
- fetch('space.launch_vehicule')
59
+ def launch_vehicle
60
+ fetch('space.launch_vehicle')
61
61
  end
62
62
  end
63
63
  end
@@ -3,7 +3,11 @@
3
3
  module Faker
4
4
  class String < Base
5
5
  class << self
6
- def random(length = 32)
6
+ def random(legacy_length = NOT_GIVEN, length: 32)
7
+ warn_for_deprecated_arguments do |keywords|
8
+ keywords << :length if legacy_length != NOT_GIVEN
9
+ end
10
+
7
11
  utf8string select_a length
8
12
  end
9
13
 
@@ -3,7 +3,11 @@
3
3
  module Faker
4
4
  class Stripe < Base
5
5
  class << self
6
- def valid_card(card_type = nil)
6
+ def valid_card(legacy_card_type = NOT_GIVEN, card_type: nil)
7
+ warn_for_deprecated_arguments do |keywords|
8
+ keywords << :card_type if legacy_card_type != NOT_GIVEN
9
+ end
10
+
7
11
  valid_cards = translate('faker.stripe.valid_cards').keys
8
12
 
9
13
  if card_type.nil?
@@ -18,7 +22,11 @@ module Faker
18
22
  fetch('stripe.valid_cards.' + card_type)
19
23
  end
20
24
 
21
- def valid_token(card_type = nil)
25
+ def valid_token(legacy_card_type = NOT_GIVEN, card_type: nil)
26
+ warn_for_deprecated_arguments do |keywords|
27
+ keywords << :card_type if legacy_card_type != NOT_GIVEN
28
+ end
29
+
22
30
  valid_tokens = translate('faker.stripe.valid_tokens').keys
23
31
 
24
32
  if card_type.nil?
@@ -33,7 +41,11 @@ module Faker
33
41
  fetch('stripe.valid_tokens.' + card_type)
34
42
  end
35
43
 
36
- def invalid_card(card_error = nil)
44
+ def invalid_card(legacy_card_error = NOT_GIVEN, card_error: nil)
45
+ warn_for_deprecated_arguments do |keywords|
46
+ keywords << :card_error if legacy_card_error != NOT_GIVEN
47
+ end
48
+
37
49
  invalid_cards = translate('faker.stripe.invalid_cards').keys
38
50
 
39
51
  if card_error.nil?
@@ -57,7 +69,11 @@ module Faker
57
69
  rand_in_range(start_year, start_year + 5).to_s
58
70
  end
59
71
 
60
- def ccv(card_type = nil)
72
+ def ccv(legacy_card_type = NOT_GIVEN, card_type: nil)
73
+ warn_for_deprecated_arguments do |keywords|
74
+ keywords << :card_type if legacy_card_type != NOT_GIVEN
75
+ end
76
+
61
77
  (card_type.to_s == 'amex' ? rand_in_range(1000, 9999) : rand_in_range(100, 999)).to_s
62
78
  end
63
79
  end
@@ -2,22 +2,67 @@
2
2
 
3
3
  module Faker
4
4
  class Subscription < Base
5
+ ##
6
+ # Produces the name of a subscription plan.
7
+ #
8
+ # @return [String]
9
+ #
10
+ # @example
11
+ # Faker::Subscription.plan #=> "Platinum"
12
+ #
13
+ # @faker.version 1.9.2
5
14
  def self.plan
6
15
  fetch('subscription.plans')
7
16
  end
8
17
 
18
+ ##
19
+ # Produces a subscription status.
20
+ #
21
+ # @return [String]
22
+ #
23
+ # @example
24
+ # Faker::Subscription.status #=> "Active"
25
+ #
26
+ # @faker.version 1.9.2
9
27
  def self.status
10
28
  fetch('subscription.statuses')
11
29
  end
12
30
 
31
+ ##
32
+ # Produces the name of a payment method.
33
+ #
34
+ # @return [String]
35
+ #
36
+ # @example
37
+ # Faker::Subscription.payment_method #=> "PayPal"
38
+ #
39
+ # @faker.version 1.9.2
13
40
  def self.payment_method
14
41
  fetch('subscription.payment_methods')
15
42
  end
16
43
 
44
+ ##
45
+ # Produces the name of a subscription term.
46
+ #
47
+ # @return [String]
48
+ #
49
+ # @example
50
+ # Faker::Subscription.subscription_term #=> "Annual"
51
+ #
52
+ # @faker.version 1.9.2
17
53
  def self.subscription_term
18
54
  fetch('subscription.subscription_terms')
19
55
  end
20
56
 
57
+ ##
58
+ # Produces the name of a payment term.
59
+ #
60
+ # @return [String]
61
+ #
62
+ # @example
63
+ # Faker::Subscription.payment_term #=> "Monthly"
64
+ #
65
+ # @faker.version 1.9.2
21
66
  def self.payment_term
22
67
  fetch('subscription.payment_terms')
23
68
  end
@@ -3,22 +3,67 @@
3
3
  module Faker
4
4
  class Superhero < Base
5
5
  class << self
6
+ ##
7
+ # Produces a superpower.
8
+ #
9
+ # @return [String]
10
+ #
11
+ # @example
12
+ # Faker::Superhero.power #=> "Photokinesis"
13
+ #
14
+ # @faker.version 1.6.2
6
15
  def power
7
16
  fetch('superhero.power')
8
17
  end
9
18
 
19
+ ##
20
+ # Produces a superhero name prefix.
21
+ #
22
+ # @return [String]
23
+ #
24
+ # @example
25
+ # Faker::Superhero.prefix #=> "the Fated"
26
+ #
27
+ # @faker.version 1.6.2
10
28
  def prefix
11
29
  fetch('superhero.prefix')
12
30
  end
13
31
 
32
+ ##
33
+ # Produces a superhero name suffix.
34
+ #
35
+ # @return [String]
36
+ #
37
+ # @example
38
+ # Faker::Superhero.suffix #=> "Captain"
39
+ #
40
+ # @faker.version 1.6.2
14
41
  def suffix
15
42
  fetch('superhero.suffix')
16
43
  end
17
44
 
45
+ ##
46
+ # Produces a superhero descriptor.
47
+ #
48
+ # @return [String]
49
+ #
50
+ # @example
51
+ # Faker::Superhero.descriptor #=> "Bizarro"
52
+ #
53
+ # @faker.version 1.6.2
18
54
  def descriptor
19
55
  fetch('superhero.descriptor')
20
56
  end
21
57
 
58
+ ##
59
+ # Produces a random superhero name.
60
+ #
61
+ # @return [String]
62
+ #
63
+ # @example
64
+ # Faker::Superhero.name #=> "Magnificent Shatterstar"
65
+ #
66
+ # @faker.version 1.6.2
22
67
  def name
23
68
  parse('superhero.name')
24
69
  end