Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/lolspeak.rb

Instance Method Summary collapse

Instance Method Details

#to_lolspeak(&filter) ⇒ Object

Translates all the words in this string. Calls Tranzlator.translate_words on the receiver using the default Tranzlator.

"Hi cat".to_lospeak -> "oh hai kitteh"

See also: LOLspeak.default_tranzlator

:call-seq:

to_lolspeak                       -> String
to_lolspeak { |word| transform }  -> String


241
242
243
# File 'lib/lolspeak.rb', line 241

def to_lolspeak(&filter)
  return LOLspeak::default_tranzlator.translate_words(self, &filter)
end

#xml_to_lolspeak(&filter) ⇒ Object

Treats the string as XML and translates all the text in this string. Calls Tranzlator.translate_xml_string on the receiver using the default Tranzlator.

See also: LOLspeak.default_tranzlator

:call-seq:

xml_to_lolspeak                       -> String
xml_to_lolspeak { |word| transform }  -> String


255
256
257
# File 'lib/lolspeak.rb', line 255

def xml_to_lolspeak(&filter)
  return LOLspeak::default_tranzlator.translate_xml_string(self, &filter)
end