class Qipowl::Bowlers::Ispru

Constants

LANG_FROM
LANG_TO

Attributes

dict[R]

Public Instance Methods

∀_regular(*args) click to toggle source

‘:regular` default handler @param [Array] args the words, gained since last call to {#harvest}

# File lib/qipowl/bowlers/i_sp_ru.rb, line 40
def ∀_regular *args
  ["#{__callee__}", [*args].flatten]
end
∀_word(method, *args, &block) click to toggle source

Drum-roll!! The main handler for words

# File lib/qipowl/bowlers/i_sp_ru.rb, line 45
def ∀_word method, *args, &block
  [(@dict[method.to_s.unbowl] || method).bowl, args]
end

Protected Instance Methods

defreeze(str) click to toggle source

def . *args end def , *args end def ; *args end def ! *args end def ? *args end def ! *args

[__callee__, args]

end def : *args

[__callee__, args]

end

Calls superclass method
# File lib/qipowl/bowlers/i_sp_ru.rb, line 68
def defreeze str
  @dict = {'Mamá' => 'Мама', 'lavados' => 'моет', 'marco' => 'раму'}
  (super str) # .typo(LANG_FROM)
end
serveup(str) click to toggle source

@see {Qipowl::Bowler#serveup}

Additionally it beatifies the output HTML

@param [String] str to be roasted

Calls superclass method
# File lib/qipowl/bowlers/i_sp_ru.rb, line 78
def serveup str
  (super str).typo(lang: LANG_TO).strip
end

Private Instance Methods

special_handler(method, *args, &block) click to toggle source

Hence we cannot simply declare the DSL for it, we need to handle calls to all the methods, starting with those symbols.

@param [Symbol] method as specified by caller (‘method_missing`.) @param [Array] args as specified by caller (`method_missing`.) @param [Proc] block as specified by caller (`method_missing`.)

@return [Array] the array of words

# File lib/qipowl/bowlers/i_sp_ru.rb, line 91
def special_handler method, *args, &block
  ∀_word method, args, block
end