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
-
#adapt(*args, &block) ⇒ Object
created an object and then adopts from the given hash and block.
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. obj = self.new *args obj.adapt(hsh, &block) obj end |