Module: Google::Translate::StringMixin

Defined in:
lib/gtranslate/mixins.rb

Overview

Extends String to add to_* and to

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method, *args) ⇒ Object



6
7
8
9
10
11
12
# File 'lib/gtranslate/mixins.rb', line 6

def method_missing(method, *args)
  if method.to_s[/^((?:\w+)?to_\w+)$/]
    Google::Tr.send($1.to_sym, self)
  else
    super
  end
end