# File lib/hashery/ini_hash.rb, line 285
    def self.write_to_file(path, inihash={}, comment=nil)
      raise TypeError, "String expected" unless comment.is_a? String or comment.nil?
      
      raise TypeError, "Hash expected" unless inihash.is_a? Hash
      File.open(path, "w") { |file|
        
        unless comment.nil?
          comment.each do |line|
            file << "# #{line}"
          end
        end

        file << IniHash.text(inihash)
      }
    end