Module: Kolom::CoreExtensions::StringMethods

Included in:
String
Defined in:
lib/kolom/core_extensions.rb

Overview

Define extensions for String class

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(method_name, *args, &block) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/kolom/core_extensions.rb', line 5

def method_missing(method_name, *args, &block)
  bengali_method = Kolom::KEYWORDS.key(method_name.to_s)
  if bengali_method
    send(Kolom::KEYWORDS[bengali_method].to_sym, *args, &block)
  else
    super
  end
end

Instance Method Details

#respond_to_missing?(method_name, include_private = false) ⇒ Boolean

Returns:

  • (Boolean)


14
15
16
# File 'lib/kolom/core_extensions.rb', line 14

def respond_to_missing?(method_name, include_private = false)
  Kolom::KEYWORDS.key(method_name.to_s) || super
end