Sha256: 222cc258022b9ab663cb7e85204722cf15ae18a4552174aba12672307b58e0f7
Contents?: true
Size: 656 Bytes
Versions: 8
Compression:
Stored size: 656 Bytes
Contents
require_relative "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 list self.results=@contact_repository.find({}) end def find filter_map = {} @@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
8 entries across 8 versions & 1 rubygems