Module: ReservedFor::MethodMissing

Included in:
String
Defined in:
lib/reserved_for/string.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

#method_missing(name, *args) ⇒ Object



5
6
7
8
9
10
11
# File 'lib/reserved_for/string.rb', line 5

def method_missing(name, *args)
  if name.to_s =~ /^reserved_for_(.*)\?$/
    ReservedFor.public_send($1.to_sym).include?(self)
  else
    super
  end
end