require 'kuzira/errors' module Kuzira def initialize(attributes = {}) if attributes attributes.each do |key, value| setter = :"#{key}=" if respond_to?(setter) public_send(setter, value) if respond_to?(setter) else raise UnknownAttributeError.new(self, value) end end end end end