class Drugbank::Base
Public Instance Methods
method_missing(method, *args, &block)
click to toggle source
Calls superclass method
# File lib/drugbank/base.rb, line 3 def method_missing(method, *args, &block) if self.attributes.keys.include?(method.to_s) self.class.send(:define_method, method,lambda{ self[method.to_s]}) return self[method.to_s] elsif self.relations.keys.include?(method.to_s) self.class.send(:define_method, method,lambda{ self.relations[method.to_s]}) return self.relations[method.to_s] else super end end