Module: Hiptionary::WordRandomizer
- Includes:
- HipsterWords
- Defined in:
- lib/hiptionary/wordRandomizer.rb
Class Method Summary collapse
Class Method Details
.get_random_number ⇒ Object
7 8 9 |
# File 'lib/hiptionary/wordRandomizer.rb', line 7 def self.get_random_number rand(0..@@hiptionary.size - 1) end |
.get_word ⇒ Object
17 18 19 20 21 22 23 24 |
# File 'lib/hiptionary/wordRandomizer.rb', line 17 def self.get_word number = get_random_number puts "--------------------------------------------------" puts @@hiptionary[number][:name] puts "Meaning: #{@@hiptionary[number][:meaning]}" puts "Example: #{@@hiptionary[number][:example]}" puts "--------------------------------------------------" end |
.get_word_count ⇒ Object
11 12 13 14 15 |
# File 'lib/hiptionary/wordRandomizer.rb', line 11 def self.get_word_count puts "--------------------------------------------------" puts "There is #{@@hiptionary.size} hipster words ready to be learned!" puts "--------------------------------------------------" end |