Module: LOLspeak

Defined in:
lib/lolspeak.rb,
lib/lolspeak/version.rb

Overview

This module encapsulates the English to LOLspeak translator. See LOLspeak::Tranzlator for more information.

Defined Under Namespace

Classes: Tranzlator

Constant Summary collapse

VERSION =
"1.0.0"
@@default_tranzlator =
nil

Class Method Summary collapse

Class Method Details

.default_tranzlatorObject

Returns the default Tranzlator. On the first time it is called, it creates a Translator using the built-in dictionary.



218
219
220
221
222
223
224
225
# File 'lib/lolspeak.rb', line 218

def default_tranzlator
  if @@default_tranzlator.nil?
    default_file = File.join(File.dirname(__FILE__), "lolspeak",
      "tranzlator.yml")
    @@default_tranzlator = Tranzlator.from_file(default_file)
  end
  return @@default_tranzlator
end

.default_tranzlator=(new_tranzlator) ⇒ Object

Sets the default Tranzlator to new_tranzlator



211
212
213
# File 'lib/lolspeak.rb', line 211

def default_tranzlator=(new_tranzlator)
  return @@default_tranzlator = new_tranzlator
end