Sha256: cbea13bd413284d190b22ba2a0e3308246b5570220ee45a4d30f94d93af7ab39

Contents?: true

Size: 717 Bytes

Versions: 1

Compression:

Stored size: 717 Bytes

Contents

# Copyright (C) 2007-2008 Annas Al Maleh
# Licensed under the LGPL. See /COPYING.LGPL for more details.

require File.dirname(__FILE__) + "/contact_repository"

class ContactManagerPresenter
  attr_accessor :results
  @@contact_attributes = [:first_name, :last_name, :email]
  @@contact_attributes.each {|attribute_name| attr_accessor attribute_name}
  
  def initialize
    @contact_repository = ContactRepository.new
    @results = []
  end
  
  def find
    filter_map = Hash.new
    @@contact_attributes.each do |attribute_name| 
      filter_map[attribute_name] = self.send(attribute_name) if self.send(attribute_name)
    end
    self.results=@contact_repository.find(filter_map)
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
glimmer-0.1.0.0 samples/contactmanager/contact_manager_presenter.rb