module Access class CitySavings def self.search(options = {}) Access::Api.new.search_city_savings options end def initialize(values) self.class.class_eval {attr_reader *values.keys } values.each do |attribute_name, attribute_value| self.instance_variable_set("@#{attribute_name}", attribute_value) end end end end