module AttrPouch::ClassMethods

Public Instance Methods

pouch(field, &block) click to toggle source
# File lib/attr_pouch.rb, line 381
def pouch(field, &block)
  if block_given?
    pouch = Pouch.new(self, field)
    @pouches ||= {}
    @pouches[field] = pouch
    pouch.instance_eval(&block)
  else
    @pouches[field]
  end
end