Module Populate
In: lib/facets/more/populate.rb

A class mixin for objects which initialize using a hash or block to simply populate attr_writers/accessors.

  class MyClass
    include Populate
    attr :a
  end

  m = MyClass.new(:a=>1)
  m.a  #=> 1

  m = MyClass.new{ |s| s.a = 1 }
  m.a  #=> 1

Methods

Public Class methods

Populating initializer.

Public Instance methods

When using, a class should generally leave the initializer alone and just fillout these two callbacks as needed.

[Validate]