Class: Faker::Books::Dune
- Inherits:
-
Faker::Base
- Object
- Faker::Base
- Faker::Books::Dune
- Defined in:
- lib/faker/books/dune.rb
Overview
A Faker module beyond your dreams, test data beyond your imagination.
Constant Summary
Constants inherited from Faker::Base
Faker::Base::LLetters, Faker::Base::Letters, Faker::Base::NOT_GIVEN, Faker::Base::Numbers, Faker::Base::ULetters
Class Method Summary collapse
-
.character ⇒ String
Produces the name of a character from Dune.
-
.planet ⇒ String
Produces the name of a planet from Dune.
-
.quote(legacy_character = NOT_GIVEN, character: nil) ⇒ String
Produces a quote from Dune.
-
.saying(legacy_source = NOT_GIVEN, source: nil) ⇒ String
Produces a saying from Dune.
- .title ⇒ String
Methods inherited from Faker::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
.character ⇒ String
Produces the name of a character from Dune
18 19 20 |
# File 'lib/faker/books/dune.rb', line 18 def character fetch('dune.characters') end |
.planet ⇒ String
Produces the name of a planet from Dune
42 43 44 |
# File 'lib/faker/books/dune.rb', line 42 def planet fetch('dune.planets') end |
.quote(legacy_character = NOT_GIVEN, character: nil) ⇒ String
Produces a quote from Dune
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 |
# File 'lib/faker/books/dune.rb', line 61 def quote(legacy_character = NOT_GIVEN, character: nil) warn_for_deprecated_arguments do |keywords| keywords << :character if legacy_character != NOT_GIVEN end quoted_characters = translate('faker.dune.quotes').keys if character.nil? character = sample(quoted_characters).to_s else character = character.to_s.downcase unless quoted_characters.include?(character.to_sym) raise ArgumentError, "Characters quoted can be left blank or #{quoted_characters.join(', ')}" end end fetch('dune.quotes.' + character) end |
.saying(legacy_source = NOT_GIVEN, source: nil) ⇒ String
Produces a saying from Dune
96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 |
# File 'lib/faker/books/dune.rb', line 96 def (legacy_source = NOT_GIVEN, source: nil) warn_for_deprecated_arguments do |keywords| keywords << :source if legacy_source != NOT_GIVEN end = translate('faker.dune.sayings').keys if source.nil? source = sample().to_s else source = source.to_s.downcase unless .include?(source.to_sym) raise ArgumentError, "Sources quoted in sayings can be left blank or #{.join(', ')}" end end fetch('dune.sayings.' + source) end |
.title ⇒ String
29 30 31 |
# File 'lib/faker/books/dune.rb', line 29 def title fetch('dune.titles') end |