Class: Faussaire::Cosmos
- Inherits:
-
Object
- Object
- Faussaire::Cosmos
- Defined in:
- lib/faussaire/cosmos.rb
Constant Summary collapse
- DATA_PATH =
File.('../../locale/fr.yml', __dir__)
Class Method Summary collapse
-
.event ⇒ String
Produces a random cosmic event.
-
.exploration ⇒ String
Produces a random space exploration name.
- .initialize_data ⇒ Object
-
.neighborhood ⇒ String
Produces a random neighborhood in the cosmos (like a galaxy or nebula).
-
.planet ⇒ String
Produces a random planet name.
Class Method Details
.event ⇒ String
Produces a random cosmic event.
32 33 34 |
# File 'lib/faussaire/cosmos.rb', line 32 def event fetch('fr.faussaire.cosmos.event') end |
.exploration ⇒ String
Produces a random space exploration name.
56 57 58 |
# File 'lib/faussaire/cosmos.rb', line 56 def exploration fetch('fr.faussaire.cosmos.exploration') end |
.initialize_data ⇒ Object
8 9 10 |
# File 'lib/faussaire/cosmos.rb', line 8 def initialize_data @data = YAML.load_file(DATA_PATH) end |
.neighborhood ⇒ String
Produces a random neighborhood in the cosmos (like a galaxy or nebula).
44 45 46 |
# File 'lib/faussaire/cosmos.rb', line 44 def neighborhood fetch('fr.faussaire.cosmos.neighborhood') end |
.planet ⇒ String
Produces a random planet name.
20 21 22 |
# File 'lib/faussaire/cosmos.rb', line 20 def planet fetch('fr.faussaire.cosmos.planet') end |