def to_hash
      self.class.schema.each_with_object({}) do |key, result|
        result[key.name] = Hashify[self[key.name]] if attributes.key?(key.name)
      end
    end
def to_hash
      self.class.schema.each_with_object({}) do |key, result|
        result[key.name] = Hashify[self[key.name]] if attributes.key?(key.name)
      end
    end
Converts the {Dry::Struct} to a hash with keys representing
 each attribute (as symbols) and their corresponding values

 @return [Hash{Symbol => Object}]

 @example
   class Book < Dry::Struct
     attribute :title, Types::Strict::String
     attribute :subtitle, Types::Strict::String.optional
   end

   rom_n_roda = Book.new(
     title: 'Web Development with ROM and Roda',
     subtitle: nil
   )
   rom_n_roda.to_hash
     #=> {title: 'Web Development with ROM and Roda', subtitle: nil}