Module: Titi::Adaptor::ClassMethods

Defined in:
lib/titi/adaptor.rb

Overview

The standard hack to construct class methods on a class that #include’s this model

Instance Method Summary collapse

Instance Method Details

#adapt(*args, &block) ⇒ Object

created an object and then adopts from the given hash and block



47
48
49
50
51
52
# File 'lib/titi/adaptor.rb', line 47

def adapt *args, &block
  hsh = args.extract_options!
  obj = self.new *args
  obj.adapt(hsh, &block)
  obj
end