Module: FandomWord

Defined in:
lib/fandom_word.rb,
lib/fandoms.rb,
lib/version.rb,
lib/fandom_word_catalog.rb

Overview

Holds all classes and methods for Fandom Word

Defined Under Namespace

Modules: Fandoms Classes: FandomRandomizer, FandomWordCatalog

Constant Summary collapse

VERSION =

Version of this gem

'0.4.0'.freeze

Class Method Summary collapse

Class Method Details

.fandomsObject

Returns the list of fandoms (categories)



19
20
21
# File 'lib/fandom_word.rb', line 19

def fandoms
  FandomRandomizer.instance.available_fandoms
end

.random_word(fandom_name_or_names = nil) ⇒ String

Returns random word from any fandom in catalog. Fandom category can be specified.

Parameters:

  • fandom_name_or_names (String, Array) (defaults to: nil)

    Fandom category or array of categories

Returns:

  • (String)

    Random word



10
11
12
13
14
15
16
# File 'lib/fandom_word.rb', line 10

def random_word(fandom_name_or_names = nil)
  if fandom_name_or_names
    FandomRandomizer.instance.random_word fandom_name_or_names
  else
    FandomRandomizer.instance.random_word
  end
end