Module: Hashme::ClassMethods

Defined in:
lib/hashme.rb

Instance Method Summary collapse

Instance Method Details

#build(*attrs) {|instance| ... } ⇒ Object

Little help. Equivalent to new.tap

Yields:

  • (instance)


40
41
42
43
44
# File 'lib/hashme.rb', line 40

def build(*attrs)
  instance = self.new(*attrs)
  yield instance if block_given?
  instance
end