Module: AutoQuery

Defined in:
lib/docusign/extensions.rb

Instance Method Summary collapse

Dynamic Method Handling

This class handles dynamic methods through the method_missing method

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



56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
# File 'lib/docusign/extensions.rb', line 56

def method_missing(method_name, *args, &block)
  string_name = method_name.to_s
  
  if (string_name =~ /\?$/) && respond_to?(string_name.gsub(/\?/, ''))
    self.class.class_eval %Q{
      def #{string_name}(*args, &block)
        !! (send "#{string_name.gsub(/\?/, '')}", *args, &block)
      end
    }
    
    send method_name, *args, &block
  else
    super
  end
end